Staredit Network > Forums > SC2 Assistance > Topic: Bank Hashing Function
Bank Hashing Function
Oct 31 2010, 10:46 pm
By: Temp  

Oct 31 2010, 10:46 pm Temp Post #1



I was inspired to write a quick bank hash function for people to use.

Just a quick note on usage. Call the HashValues function, pass in the bank you have open and the name of the KEY you will be using to store the hash value in the bank. Then put the value you get back in the KEY that is reserved for the hash value. To test if the bank is valid simply check to see if the computed hash value of the bank is the same as the hash value stored in the bank.

UPDATES: Made unit hash stronger, it has also been tested so it should work for anyone who wishes to use it to protect their banks from tampering (NOTE: not 100%, you get around this by looking at how the hash is calculated and hashing the new values yourself)

The has can probably be better, if anyone wants to help contribute to this you are more than welcome to.

TODO:
-Make string hashing stronger.
-Figure out how to do any sort of hashing with text (any ideas anyone?)
-Enhance unit hashing to cover all important attributes (partially done)

Attachments:
hashTest.SC2Map
Hits: 0 Size: 188.17kb
BankHash.SC2Lib
Hits: 0 Size: 77.06kb

Post has been edited 3 time(s), last time on Nov 1 2010, 7:35 pm by Temp.



None.

Nov 1 2010, 1:44 pm Temp Post #2



Quick, more detailed instructions, also OP was updated with an updated library:

Data->Library->Import Library (the one you downloaded)
Then you can use the functions included in the library. The only important one is HashValues (anyone know how to make a function private to a library?)

Then when you are about to save your bank call the HashValues function and pass in the bank and a string which represents the key that you will store the hash value in the bank.
Put the value you get back from the function in the bank in any section where the key is the same string you passed into the function.
NOTE: The key must be unique globally in the bank (that is in all sections)


Then to check whether the bank is valid open the bank and run the HashValues function the same way again and then compare the value you get back from the function with the value you already stored in the bank under that unique key.



None.

Nov 1 2010, 7:37 pm Temp Post #3



Unit hashing is now much stronger, there are still probably values im missing (for items and such). Added a test map to the OP. To use simply open the test map, hit Init bank and the Save bank. You can run a check now and it will say same. Exit SC and open the bank (Called TestBank) and edit some values. Reopen the map and hit check, should say different.



None.

Nov 2 2010, 1:10 am payne Post #4

:payne:

Have you tested this on multiplayer mode? Because I already know of experience that Banks can work when testing the map locally, but not when published publically.



None.

Nov 2 2010, 2:37 am Temp Post #5



I haven't, probably should. Don't see it changing the hashing part though.



None.

Feb 11 2011, 7:52 pm Jack Post #6

>be faceless void >mfw I have no face

Lemme get this straight, I can use this with a key to encrypt bank info, correct? If I just want to encrypt bank info, no unit info or anything, will it do that for me?



Red classic.

"In short, their absurdities are so extreme that it is painful even to quote them."

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[06:24 pm]
Oh_Man -- https://youtu.be/pPZafFJOi48 crazy good
[09:51 am]
NimoStar -- And Pathfinding in SC1 was not *that* bad, the problem is that it was designed as a flat 2D game like WC1 (and it was in the alpha) and then switched to isometric without changing the base code. So its actually a flat game pretending to be isometric. With the custom competitive maps that use larger ramps and elevation, pathfinding is quite fixed.
[09:47 am]
NimoStar -- The unlocking and map choice was fine, but mostly in WoL - In HoTS the worst of all units are irrelevant because Kerrigan has infinite summon and stuff. And even in WoL the spaceship instakill map powers are better than units. If I could RTS in my RTS that'd be great.
[2026-3-05. : 8:45 pm]
NudeRaider -- Nekron
Nekron shouted: NudeRaider not that the og sc1 campaigns are particularly good mechanically but cmon, SC2 map mechanics are the opposite of fun
There's many parts to it. I think the raw rts gameplay of sc1 is unsurpassed to this day. And I too never liked that sc2 missions always rush you in some way or another, because I like to take my time. However I still have to admit that they way they did it often was always pretty cool. Like lava rising and receding, a huge-ass mothership destroying bases, undead coming at night, just to name a few, those are definitely creative, so I'm sure there's people that liked it. But that's not even what I meant. It's the unlocking of new features and upgrades and choice which map to play next that made it so much more motivating for me.
[2026-3-05. : 6:49 pm]
Nekron -- like the train maps, enemies just kind of come at you (I'm not sure if there is a real enemy base, there might be one just on a technicality - you are to never interact with its production) and then you gotta chase trains for lulz
[2026-3-05. : 6:48 pm]
Nekron -- and even in WoL imo everything ends up feeling like you're just getting a lot of hidden timers that kind of force you into awkward resource management between main objective and defending your base against enemies from beyond this world
[2026-3-05. : 6:47 pm]
Nekron -- some ideas were okay in WoL but the further you go the worse it gets
[2026-3-05. : 6:46 pm]
Nekron -- NudeRaider
NudeRaider shouted: also the sc2 campaign mechanics were way more fun and involving
not that the og sc1 campaigns are particularly good mechanically but cmon, SC2 map mechanics are the opposite of fun
[2026-3-03. : 9:33 pm]
Ultraviolet -- boo sacrilege, get outta here
[2026-3-03. : 8:47 am]
NudeRaider -- also the sc2 campaign mechanics were way more fun and involving
Please log in to shout.


Members Online: Roy, NimoStar