1.0.2 • Published 4 years ago

base-hash v1.0.2

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

base-hash

NPM Package

This is an awesome lightweight util helps to hash with different base

Example

const BaseHash = require('base-hash');

const baseHash = new BaseHash();

console.log(baseHash.encode(12345)); //dnh
console.log(baseHash.decode('dnh')); //12345

By default the characters used for hashing are

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789

If you want to override the characters please refer the below code

const BaseHash = require('base-hash');

const baseHash = new BaseHash('abcde');

console.log(baseHash.encode(12345)); //deddea
console.log(baseHash.decode('deddea')); //12345

You also can check source code

LICENSE

MIT