Compute Hash


A hash is a function that converts one value to another. Hashing is used to index and retrieve items in a database because it is faster to find the item using the shorter hashed key than to find it using the original values. Hashing is a natural fit for cryptography because it masks the original data with another value. A hash function can be used to generate a value that can only be decoded by looking up the value from a hash table.

Sheetkraft has its own .sk function – ComputeHash.sk which creates hash from an input using a specified hash algorithm.

How to use the function ComputeHash.sk?

Suppose you want to create hash for a specific input. (See figure below)

img1


Step 1:

In your preferred cell (where you want the hash value to be generated) type “ =ComputeHash.sk( ” and press the Function(fx) button . The following dialogue box opens up.

img2


Step 2:

In the section Value, browse and choose the cell which contains your input. (Cell B2 in this case)

Step 3:

In the section Algorithm, input the type of algorithm that would be used to hash. (Some of the different types of algorithms are SHA1, MD5, SHA256, SHA384, SHA512)

Step 4:

In the section Input Type, you need to need enter input format type. Generally it defaults to text.(Other types of Input supported are – Base64, Hex.)

Step 5:

In the section Output Type, you need to enter output format type. Generally it defaults to Base64. (Other types of Output supported are – Hex.) Following the above steps the dialogue box should look like the following. (See figure below)

img3


Step 6:

Clicking on OK generates our output, i.e. our hash.

img4


Note:

  • Base64 is a group of similar binary-to-text encoding schemes that represent binary data in an ASCII string format. Base64 encoding schemes are commonly used when there is a need to encode binary data that needs to be stored and transferred over media that are designed to deal with ASCII. This is to ensure that the data remain intact without modification during transport
  • Base16 or hex, the hexadecimal numbering system uses combinations of 16 character digits to represent numbers. Hexadecimal uses all ten numbers in the decimal system (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9) and letters A through F.
  • The MD5 message-digest algorithm is a widely used hash function producing a 128-bit hash value.
  • SHA-1 (Secure Hash Algorithm 1) is a cryptographic hash function which takes an input and produces a 160-bit (20-byte) hash value known as a message digest – typically rendered as a hexadecimal number, 40 digits long.
  • SHA-256 is one of the successor hash functions to SHA-1.