Skip to content

hash

This content is for v0.2.1. Switch to the latest version for up-to-date documentation.

The hash namespace provides direct access to common hashing algorithms.


FunctionSignatureReturn TypeDescription
hash.sha256hash.sha256(str)stringComputes SHA-256 digest in lowercase hexadecimal.
hash.sha1hash.sha1(str)stringComputes SHA-1 digest in lowercase hexadecimal.

var file_content = fs.read("package.json");
var checksum = hash.sha256(file_content);
print("SHA-256 Checksum: " + checksum);