File.prototype.fileHash()

Return the hash of the file.

Syntax

file.fileHash() string

Description

Return a hash of the file, including all its children, attributes and body. It is a fingerprint of the file. When two files have the same fileHash, it is guaranteed that they equal, which has a significance when comparing different versions of the same websites. The same hash means the file didn’t change.

Note that the format of the fileHash is not fixed. The only guarantee is that it is a HEX string no longer than 256 bytes (in HEX form).

Examples

An example fileHash.

Subscribe to our newsletter!