Hash

Hash[expr]

gives an integer hash code for the expression expr.

Hash[expr,"type"]

gives an integer hash code of the specified type for expr.

Details

  • Hash[expr,] 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

Examples

open allclose all

Basic Examples  (3)

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]=

Scope  (8)

Applications  (2)

Properties & Relations  (3)

Neat Examples  (1)

See Also

FileHash  GenerateSymmetricKey  LeafCount  ByteCount  Dispatch

Introduced in 1988
(1.0)
| Updated in 2010
(8.0)