hash
This content is for v1.0. Switch to the latest version for up-to-date documentation.
The hash namespace provides direct access to common hashing algorithms.
Quick Reference
Section titled “Quick Reference”| Function | Signature | Return Type | Description |
|---|---|---|---|
hash.sha256 | hash.sha256(str) | string | Computes SHA-256 digest in lowercase hexadecimal. |
hash.sha1 | hash.sha1(str) | string | Computes SHA-1 digest in lowercase hexadecimal. |
Examples
Section titled “Examples”var file_content = fs.read("package.json");var checksum = hash.sha256(file_content);
print("SHA-256 Checksum: " + checksum);