Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serious

Serious IDs are numeric, making them compatible with contexts that require numeric identifiers, such as database primary keys. Each ID stays under 53 bits — the maximum safe integer size in JavaScript — and fits comfortably in a 64-bit integer column in any database.

Serious IDs are sortable and monotonically increasing, so they work reliably as primary keys in distributed databases. They are guaranteed collision-free through the year 2255, even when multiple IDs are generated within the same millisecond, as long as a single Serious instance is responsible for generation.

Install

npm i @nextform/serious

Usage

Import the Serious class and use the generate() method.

import { Serious } from '@nextform/serious'

Serious.generate() // => 1776801003243546

About

Generate numerical IDs that are compatible with JavaScript and 64-bit data types

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages