0.1.4 • Published 1 year ago

eska-id v0.1.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

Install

npm i eska-id

Features

  • Really simple to understand and implement
  • Guaranteed uniqueness
  • Timestamped
  • Shorter than UUIDs
  • Cryptographically secure by design

The ID

Eska IDs consist of 3 sections: the prefix, the Superflake and the tail, which is simply a cryptographically secure random string.

Superflake

Superflake is a revolutionary technology based on Twitter's Snowflake. Superflake is generated by concatenating:

  • a 42-bit timestamp,
  • a 10-bit node ID, and
  • a 12-bit sequential number.

If you want to generate Superflakes without using Eska or implementing your own code, use this library.

Example

import { Eska } from "eska-id";

// Initialize Eska
const eska = new Eska({ prefix: { content: "u" } });

// Generate an Eska ID
eska.generate();
// => u_692461092816395059286eafdfb2a12963b
0.1.4

1 year ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago