We deliver solutions for the AI eraâcombining symbolic computation, data-driven insights and deep technology expertise.
FileHash[file]
gives an integer hash code for the contents of the specified file.
FileHash[file,"type"]
gives an integer hash of the specified type.
FileHash[file,"type","format"]
gives a hash code in the specified format.
FileHash[{file,range},…]
gives the hash code for the specified range of bytes.
FileHash[{filespec1,filespec2,…},…]
gives the hash codes for a list of files.
DetailsThe "SHA512" hash code of a file:
The "SHA512" hash code of the first 100 bytes of a file:
The "MD5" hash code in hexadecimal form:
Hash of a CloudObject:
Scope (11) File and Range Specifications (6)Compute a hash for the first 100 bytes of a file:
Compute a hash for the last 100 bytes:
Compute a hash for bytes 100 through 200:
Compute a hash for all bytes except the first 100 or the last 100:
Compute the hash for byte 100 only:
Compute the hashes of several files:
Find the hash for a complete file as well as several subsets of it:
Create a CloudObject:
Find the hash of the data contained in the CloudObject:
By default, MD5 hash of the full range is calculated:
For hashing, the data from the CloudObject is represented as a string including the newline:
The same hash using the sequence of bytes:
The same result is given independently of the current stream position:
Create an empty file and cloud object:
Put the same content in the file and cloud object:
Also open a stream pointing at the file:
The hashes of all three objects are the same:
Hash Types and Formats (5)512-bit SHA code given as an integer:
512-bit SHA code given as a decimal string, including leading zeros:
Compare the different string representations of a hash:
The double SHA code of the first 50 bytes of a file, given as a ByteArray:
The byte array contains the 256 bits of the result:
View the individual bytes in the array:
Properties & Relations (10)The default range specification is All:
Hashing zero bytes is equivalent to finding the hash of an empty file:
"Integer" is the default format:
"DecimalString" is the string version of "Integer", padded with zeros if necessary:
"HexString" is a base-16 representation, padded with zeros if necessary:
"Base36String" is a base-36 representation, padded with zeros if necessary:
"Base64Encoding" encodes bytes of the result using Base64 encoding:
FileHash[file,code] is effectively equivalent to Hash[ReadByteArray[file],code]:
FileHash[file,code] is effectively equivalent to Hash[ByteArray@Import[file,"Byte"]]:
Wolfram Research (2007), FileHash, Wolfram Language function, https://reference.wolfram.com/language/ref/FileHash.html (updated 2020). TextWolfram Research (2007), FileHash, Wolfram Language function, https://reference.wolfram.com/language/ref/FileHash.html (updated 2020).
CMSWolfram Language. 2007. "FileHash." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/FileHash.html.
APAWolfram Language. (2007). FileHash. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FileHash.html
BibTeX@misc{reference.wolfram_2025_filehash, author="Wolfram Research", title="{FileHash}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/FileHash.html}", note=[Accessed: 12-July-2025 ]}
BibLaTeX@online{reference.wolfram_2025_filehash, organization={Wolfram Research}, title={FileHash}, year={2020}, url={https://reference.wolfram.com/language/ref/FileHash.html}, note=[Accessed: 12-July-2025 ]}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4