This is a simple hash function library for Cloudflare Workers. It supports the following hash functions:
- SHA-1 WEBCRYPTO SUPPORTED
- SHA-256 WEBCRYPTO SUPPORTED
- SHA-384 WEBCRYPTO SUPPORTED
- SHA-512 WEBCRYPTO SUPPORTED
- MD5 WEBCRYPTO SUPPORTED
- BASE64 / BASE64-DECODE
- XXHASH32
- XXHASH64
- BCRYPT / BCRYPT-COMPARE
- WHIRLPOOL / WHIRLPOOL-DECODE
- SHA3-224
- SHA3-256
- SHA3-384
- SHA3-512
- KECCAK224
- KECCAK256
- KECCAK384
- KECCAK512
- MD6
- CRC32
- CRC32C
npm install cf-workers-hash
Check the example
directory.
import { sha1, sha256, sha384, sha512, base64, base64Decode, md5, xxhash64, xxhash32, bcrypt, bcryptCompare, whirlpool, whirlpoolDecode, sha3_512, sha3_224, sha3_256, sha3_384, keccak512, keccak384, keccak256, keccak224, md6, crc32, crc32c } from 'cf-workers-hash';
await sha1('test');
npm test