1.0.8 • Published 10 months ago

clerobee v1.0.8

Weekly downloads
31
License
MIT
Repository
github
Last release
10 months ago

Clerobee - a featureful UID generator

NPM

js-standard-style

======== clerobee is a very handy utility library allowing to generate UIDs considering actual time, network resources and process in a distributed environment.

Use cases

Following use cases are supported:

  • Normal UIDs: Identifiers for general usage with length between 4 and 256. Can be used as cryptographic keys, user IDs, session keys, etc.

  • Derived UIDs: To express ownership-like relations between identifiers.

    	If you have to identify devices and be able to link them to a user with verify the ownership against the userID, then simply generate a UID for the user and generate derived UIDs for the devices.
    
    	Therethrough the ownership of the device where for example a REST request is coming, can be verified.
  • Sourced UIDs: Using a JS object data as source for the generation process.

    	For example to generate product/license keys based on user information and to check if they can be matched while a possible registration process later on.

Usage

var Cerobee = require('clerobee');

// optional default length for the IDS is passed.
// 16 would be used if nothing is given.
var cerobee = new Cerobee( 128 );

...

// generate a normal UID with length of 128
var nID = cerobee.generate();

// generate a normal UID with length of 16
var nID_2 = cerobee.generate( 16 );

...

// Generates derived UID using the 'nID' as basis.
// Its length will be the same: 128
var sID = cerobee.generate( nID );

// Tests if 'sID' is really derived from 'nID'.
// Test will fail will any other UIDs but 'sID'
var test_1 = cerobee.isDerived( nID, sID );

...

// Creates user data
var customer = { email:'test@provider.org' };

// Generates Sourced UID based on customer data with length of 128
var pID = cerobee.generate( customer, 128 );

// Tests if the given sourced UID relly carries the given user data.
// Test will fail with any other pair of user data and UID but this
var test_2 = cerobee.isSourced( reference, 128, pID );

And that's it!

License

MIT

Changelog

  • 0.0.1: Initial release...
1.0.8

10 months ago

1.0.7

1 year ago

1.0.6

2 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.9.8

7 years ago

0.9.7

7 years ago

0.9.6

7 years ago

0.9.5

7 years ago

0.9.0

7 years ago

0.8.7

8 years ago

0.8.6

8 years ago

0.8.5

8 years ago

0.8.0

8 years ago

0.7.0

9 years ago

0.6.8

9 years ago

0.6.7

9 years ago

0.6.6

9 years ago

0.6.5

9 years ago

0.5.1

9 years ago

0.5.0

9 years ago

0.3.0

10 years ago

0.2.2

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago

0.0.3

11 years ago

0.0.2

12 years ago

0.0.1

12 years ago