VINDICTA
Crypt · Library
Bunni.fun
ChocoSploit
Cryptic
Potassium
Seliware
SirHurt
Solara
Velocity
Volcano
Volt
Wave
Xeno

crypt.hash

Hashes data with the specified algorithm.

function crypt.hash(data: string, algorithm: string): string

Synopsis

How it works

Computes a cryptographic hash digest of the input data using the specified algorithm. The input is processed through the hash function’s compression rounds and the resulting digest is returned as a hexadecimal string.

Supported algorithms

AlgorithmDigest SizeHex CharsSecurity
md5128 bits32Broken — collision attacks exist. Integrity checks only
sha1160 bits40Broken. Avoid for security-critical use
sha256256 bits64Strong. SHA-2SHA (hash family)Secure Hash Algorithm family: SHA-1 (160-bit, broken), SHA-256/SHA-384/SHA-512 (SHA-2 family, secure), SHA3-256 (Keccak-based). Used by crypt.hash() to produce fixed-size digests from arbitrary input data. family, Merkle–DamgårdMerkle–DamgårdA construction used by MD5, SHA-1, and SHA-2 family hashes. Processes input in fixed-size blocks through a compression function, chaining intermediate hash values. Vulnerable to length-extension attacks. construction
sha384384 bits96SHA-512 truncated. Extra collision resistance
sha512512 bits128SHA-2 family. 80 rounds of compression
sha3-256256 bits64Keccak spongeKeccak spongeThe permutation-based construction used by SHA-3. "Absorbs" input blocks into a state array, then "squeezes" output. Immune to length-extension attacks unlike Merkle–Damgård hashes. construction (different design than SHA-2)
sha3-512512 bits128Keccak sponge, 1600-bit state
All hash functions are one-way (cannot be reversed) and deterministic (same input always produces same output).

Usage

MD5 hash
print(crypt.hash("Hello, World!", "md5")) "cc">--> 65A8E27D8879283831B664BD8B7F0AD4

Parameters

data string
The data to hash.
algorithm string
Hash algorithm name (e.g., "sha256", "md5").

Returns

string Uppercase hex-encoded hash digest.