Hash functions
Hash functions take variable-length inputs and produce fixed-length outputs of text that can't be reversed or decoded. The resulting output can only be compared. Hashing is used for integrity verification.
For example, a typical business use of hash functions is for the secure storage of user passwords.
When a user sets or changes a password, the system does not store the original password. Instead, it stores a hash value and a salt in the database.
First, a unique string (salt), is added to the user's password. Salting the password ensures that, even if two users have the same password, the password hash values will be different.
Next, the salt and password are hashed and the password hash value and unique salt are stored in the database. The original password is not saved.
When the user attempts to log in, the system retrieves the stored salt and password hash, calculates a new hash, and compares the new hash to the stored password hash. This method protects users if the database is breached.
The following hash functions can be used in Make:
Function | Description |
|---|---|
sha1 | The sha1 function has an output size of 160 bits. Though faster than the sha256 and sha512 functions, it is not as secure. It is generally not recommended for use. |
sha256 | The sha256 function has an output size of 256 bits. It is secure to use for data integrity and performs quickly on 32-bit systems. SHA-256 is a widely accepted standard that is used often. |
sha512 | The sha512 function has an output size of 512 bits. SHA-512 is used for the highest level of security or when 64-bit is required. |
md5 | The md5 function has an output size of 128 bits. It's most commonly used to validate that a file has been downloaded correctly without any missing or corrupted data. It is not recommended for use otherwise. |
You can find hash functions under the Text and binary functions tab:








