A fast string shortener that generates 8-character codes using SHA-256 and Base62 encoding, implemented as a native Node.js addon in C++.
- Fast native C++ implementation
- Consistent 8-character outputs
- Cryptographically secure using SHA-256
- Base62 encoding (0-9, a-z, A-Z)
- Deterministic results - same input produces same output
npm install theshortener --save
const shortener = require('theshortener');
// Generate short code
const shortCode = shortener.gen('https://google.com');
console.log(shortCode); // Outputs: "Qhq1TQ2n"
npm i -g theshortener
Use from command line:
theshortener https://google.com
Qhq1TQ2n
- Node.js
- C++ compiler
- OpenSSL development libraries
npm run build
npm test
- Currently in BETA - not recommended for production use
- The output is always 8 characters long
- Uses OpenSSL for SHA-256 hashing
- This is a one-way hashing implementation. Reverse lookups (getting original STR from short code) require storing STR-to-hash mappings in a database.
DY - Dunno Yet