**Hash function package** for hashing id's ( in positive integer ) to an alphanumeric short string using a 6 bit map ( User can also prvide thier own Custom 6 bit map )
npm install 6bithashbash
npm install 6bithash
`
$3
`bash
pnpm add 6bithash
`
Then, you can import the hash function as :
`js
import { generateHash } from '6bithash';
`
or
`js
const { generateHash } = require('6bithash');
`
$3
The custom hash function must have key as 6bit integers and value as you want as a string.
Example:
`js
import { generateHash } from '6bithash';
myMap = {
"000000" : "u",
...
...
"111111" : "o",
}
const Number = 1001;
const result = generateHash(Number,{myMap});
`
$3
- The minimum number of characters in a string hash depends on the how big the number is.
- Pass a larger number as a Argument to get a hash with more characters.
- If you are using TypeScript the result type is string.
Example:
Javascript :
`js
const result = generateHash(959492);
console.log(result); // result = dQqe
`
TypeScript :
`ts
const result:string = generateHash(959492);
console.log(result); // result = dQqe
``