This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

Hash

Hash[expr]
gives an integer hash code for the expression expr.
Hash
gives an integer hash code of the specified type for expr.
  • Hash will always give the same result for the same expression expr.
  • Possible hash code types include:
"Adler32"Adler 32-bit cyclic redundancy check
"CRC32"32-bit cyclic redundancy check
"MD2"128-bit MD2 code
"MD5"128-bit MD5 code
"SHA"160-bit SHA-1 code
"SHA256"256-bit SHA code
"SHA384"384-bit SHA code
"SHA512"512-bit SHA code
Digital fingerprint of data:
MD5 checksum given in hexadecimal form:
In[1]:=
Click for copyable input
Out[1]=
 
Digital fingerprint of data:
In[1]:=
Click for copyable input
Out[1]=
 
MD5 checksum given in hexadecimal form:
In[1]:=
Click for copyable input
Out[1]=
Adler 32-bit cyclic redundancy check:
32-bit cyclic redundancy check:
128-bit MD2 code:
128-bit MD5 code:
160-bit SHA code:
256-bit SHA code:
384-bit SHA code:
512-bit SHA code:
Provide a "checksum" to validate data integrity:
Change some of the data:
The checksum has changed:
A concatenated cryptographic hash function:
Hash code of "abcdef":
The hash is always the same for identical expressions:
Distinct hash codes come from distinct inputs:
Distinct inputs can give the same hash codes:
Distribution of hash values:
New in 1 | Last modified in 8