0.0.1-security • Published 10 months ago

blossom-flex-ui-localization v0.0.1-security

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

abcq

Generates character combinations from numbers: a b c ... aa ab ac ... foo fop foq

npm

  • Convert numbers to character combinations.
  • Count by character combination
  • Create unique ids
  • Create simple hashes
npm i abcq
## or
yarn add abcq

Basic usage

import Abcq from "abcq";
const shortid = new Abcq();

shortid.generate();
// -> a
shortid.generate();
// -> b
shortid.encode(1234567890);
// -> clRjXk
shortid.decode("clRjXk");
// -> 1234567890

When unicorns make love

Use an Array for chars if it contains special characters. Set the counter to modify the start point

import Abcq from "abcq";

const unicornLove = new Abcq({
	chars: ["🦄", "💖"],
	counter: 42
});

unicornLove.generate();
// -> 🦄💖💖🦄💖
unicornLove.encode(8);
// -> 🦄💖🦄

Options

chars

  • type: { string[] | string }
  • default: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'

counter

  • type: { number }
  • default: -1

Methods

generate

import Abcq from "abcq";
const abc = new AbcQ();
abc.generate();
// -> a
abc.generate();
// -> b

encode

import Abcq from "abcq";
const abc = new AbcQ();
abc.encode(1234567890);
// -> clRjXk

decode

import Abcq from "abcq";
const abc = new AbcQ();
abc.decode("clRjXk");
// -> 1234567890
0.0.1-security

10 months ago

12.1.3

11 months ago

12.1.2

1 year ago

2.0.0

1 year ago