crypt.hash
Hashes data. Default algorithm: sha384.
Syntax
crypt.hash(data: string, algorithm?: string) -> string
Parameters
| Parameter | Type | Description |
|---|---|---|
data | string | The data payload to process or send. |
algorithm? | string | The hashing algorithm name. |
Returns
| Type | Description |
|---|---|
string | The returned string. |
Description
crypt.hash is part of the Crypt library. Crypt functions process data locally. Keys, hashes and encrypted buffers remain inside the process.
The call is a predicate: it inspects the current state and returns a boolean without modifying anything.
Example
print(crypt.hash("hello", "sha256"))
Notes
- Never log keys or decrypted buffers in production scripts.