Convert any integer to a short alphanumeric version.
npm install alpha-id-jsbash
npm i alpha-id-js
`
Via CDN:
`html
`
Getting Started
Simple usage looks like:
`javascript
const AlphaID = require('alpha-id-js');
// or from browser ->
const encodedString = AlphaID.convert(258456357951);
console.log(encodedString);
// Output: '4y7exoH'
const originalNumber = AlphaID.recover('4y7exoH');
console.log(originalNumber);
// Output: 258456357951
`
Configuring a Global Key
You can set a global key that will be used for encoding and decoding if no specific key is provided. This can be done using the config method:
`javascript
const AlphaID = require('alpha-id-js');
AlphaID.config('my_key');
const encodedString = AlphaID.convert(258456357951);
console.log(encodedString);
// Output: '4ymMZq9'
const originalNumber = AlphaID.recover('4ymMZq9');
console.log(originalNumber);
// Output: 258456357951
``