Skip to content

Latest commit

 

History

History
64 lines (49 loc) · 1.58 KB

README.md

File metadata and controls

64 lines (49 loc) · 1.58 KB

Eska

The simple, functional and customizable ID system.
wile.tk »


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