abcq
Generates character combinations from numbers: a b c ... aa ab ac ... foo fop foq
- Convert numbers to character combinations.
- Count by character combination
- Create unique ids
- Create simple hashes
npm i abcq## or yarn add abcq
Basic usage
;const shortid = ; shortid;// -> ashortid;// -> bshortid;// -> clRjXkshortid;// -> 1234567890
When unicorns make love
Use an Array
for chars
if it contains special characters.
Set the counter to modify the start point
; const unicornLove = chars: "🦄" "💖" counter: 42; unicornLove;// -> 🦄💖💖🦄💖unicornLove;// -> 🦄💖🦄
Options
chars
- type: { string[] | string }
- default: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
counter
- type: { number }
- default: -1
Methods
generate
;const abc = ;abc;// -> aabc;// -> b
encode
;const abc = ;abc;// -> clRjXk
decode
;const abc = ;abc;// -> 1234567890