Hash & Encoding
A comprehensive suite of hashing, UUID, encoding, and lightweight cryptographic utilities—including JWT-style signing, `stream-cipher` encryption, and more.
Overview
A comprehensive suite of hashing, UUID, encoding, and lightweight cryptographic utilities—including JWT-style signing Signet, stream-cipher encryption Cipher, and more.
Info
Does not rely on Node.js or Web APIs. Works on any JS engine
Imports
// All hash, UUID, encryption, and encoding utilities can be imported
// from the toolbox-x/hash module using the following pattern:
import { utilityName } from 'toolbox-x/hash';Available Utilities
Hash Functions
- md5 - Compute
MD5hash (32-character hex) - sha1 - Compute
SHA-1hash (40-character hex) - sha256 - Compute
SHA-256hash (64-character hex)
UUID Utilities
- uuid - Generate RFC-compliant UUIDs (versions 1, 3, 4, 5, 6, 7, 8)
- decodeUUID - Decode UUIDs into version, variant, and timestamp information
- Version Checkers - Type-safe (branded type) validation for specific UUID versions
Encryption/Authentication Tools
- Signet - Sign, decode, verify tokens in
JWTstyle - Cipher - Encrypt, decrypt text in
stream-cipherencryption style
Other Utilities
- randomHex - Generate cryptographically secure random hex strings
- randomBytes - Generate cryptographically secure random bytes (
Uint8Array) - randomNumeric - Generate cryptographically secure random numeric strings
- randomAlphaNumeric - Generate cryptographically secure random alphanumeric strings
- Encoding & Crypto Utilities - Low-level encoding, decoding, and cryptographic functions
- TextCodec - Convert text between hex, binary, and Base64 formats
Quick Start
playground.ts
Features
- Cross-platform - Works in Node.js, browsers, and edge runtimes
- Type-safe - Full TypeScript support with branded types
- RFC compliant - Follows UUID and hash specifications
- No dependencies - Pure JavaScript implementation
Common Use Cases
- Generating unique identifiers
- Data integrity verification
- Creating random tokens and nonces
- Cryptographic hashing needs
- Encrypting/decrypting text, tokens etc.
Last updated: Tue, Jun 16, 2026 06:17:07PM (UTC)
