alphastring

1.0.2 • Public • Published

alphastring

A minimal alphabetical semi-unique id generator. Best for random string generation in scenarios where strict uniqueness is not imperative.

This package should be used in non critical code, it is for convenience.

Not cryptographically sound! Not unique, only pseudo random!

let auid = require('alphastring');
 
console.log(auid()); // kfbxtyurktqm
console.log(auid(6)); // hkqqlw
console.log(auid(40)); // tmqxwarcpfxnffzgacgehbgvaemfsnviwpffldkx
function createClass() {
    let componentName = alphastring();
    let propertyName = alphastring();
 
    let functionString = `return function ${componentName}(){this.${propertyName} = 'foo'; this.propertyName = '${propertyName}';}`;
 
    return Function(functionString)();
}

Usage

NPM

default alphastring();

Returns an alphabetical string of 12 characters.

length alphastring(length);

Returns an alphabetical string of desired length.

License

MIT, see LICENSE.md for details.

Dependents (1)

Package Sidebar

Install

npm i alphastring

Weekly Downloads

10

Version

1.0.2

License

MIT

Last publish

Collaborators

  • limeandcoconut