Hash Lib

Hash Lib 2.0.1

This is an library to use hash functions with triggers in Starcraft 2 Maps. I hope you need it for some reason and that you like it. ;P If you want to use this library, I don't want to force you to put my credits in your map, I'm only asking for it.

If you don't know what hash functions are, you might want to find out: http://en.wikipedia.org/wiki/Hash_function, but you can also read my explanation on hash functions which should be easier to most people: http://www.sc2mapster.com/assets/md5-hash/pages/hash-functions/.

Download Latest Release (Support Link)

Version Archive (Ad-Free Link)

Note: This mod has been discontinued since hash codes are already automatically included in bank files.


To generate a hash code, you need to have some input to digest. In this library that's called the 'hash input'. You fill the hash input and then generate a hash code from that. There are some actions to fill the hash input. The first action we need to use it the "Initialize Hash Input" function. With this function, you start of with a clean hash input. Do this every time you want create a new hash input, like when you want to generate a different hash code. Remember, the hash input should not be used anymore when you already generated a hash code with it, just initialize it again.

Then, to add data, there are different actions available. The following types of data are supported:

  • Boolean
  • Byte
  • Integer
  • Real
  • String
  • Unit Note: Text is not available yet. The action to add one of these types will look like this: "Add[Type]ToHashInput" where [Type] should be one of the supported types. For example, to add a boolean, use this function: "AddBooleanToHashInput".

Once you have filled the hash input like you want, you can use the function to generate the hash code. There are different functions for different hash functions, and they return a string containing the hexadecimal representation of the hash code. The following hash algorithms are supported by this lib:

  • MD5 (GenerateMd5HashCode)
  • SHA-256 (GenerateSha256HashCode) The functions to use a certain hash algorithm are written behind them within brackets.


So to generate a SHA-256 hash code from the string "abc", you use the following actions/script:

Actions in Grammar Text

  • Initialize Hash Input
  • Add String "abc" To Hash Input
  • Variable - Set Hash Code = (Generate SHA-256 Hash Code)


        string hashCode;
        hashCode = GenerateSHA256HashCode();

You must login to post a comment. Don't have an account? Register to get one!

  • Avatar of windowssiebenfan windowssiebenfan Feb 01, 2014 at 19:04 UTC - 0 likes

    Still using this cause Blizzard Hash got hacked.

  • Avatar of tordecybombo tordecybombo Sep 18, 2011 at 07:15 UTC - 1 like

    This is still good because Blizzard's hash would fail to verify sometimes.

  • Avatar of magnificence7 magnificence7 Sep 12, 2011 at 15:32 UTC - 0 likes


    I haven't really continued this anymore since Blizzard started putting hash codes in bank files themselves. If you want to continue this, or use it for any other purpose, I'll put a license in it for you.

    Good luck.

    \m/ . ENSLAVED . \m/ . AMON AMARTH . \m/ . CHTHONIC . \m/ . BATHORY . \m/ . GORGOROTH/GOD SEED . \m/ . OPETH . \m/
  • Avatar of avogatro avogatro Jan 05, 2011 at 06:23 UTC - 0 likes

    Nice work.
    I saw some sha256 values in Starbattle. I think the creator uses your lib. :D
    SHA512 could be fun. :D

    Most people will use sha256 because it is secure and don't cost too many space,
    which is limited by blizzard.

    Avoid array == write all functions involving array into the main.
    I like it, because it is simple.

    thx for your lib. Could you change the license to MIT or BSD ?
    Or write All Rights Reserved into the source code.



Date created
Nov 28, 2010
Last update
Sep 12, 2011
Development stage
All Rights Reserved
Recent files