Skip to content

Hybrid ID GeneratorCompact IDs.
Explicit machine fields.

Generate configurable bigint identifiers in Node.js and browsers. Encode them for URLs, inspect their fields, and check their age.

The default 81-bit ID layout

Generate an ID ​

ts
import { HID } from 'hybrid-id-generator';

const generator = new HID({ machineId: 1, useCrypto: true });
const id = generator.nextId();
console.log(id.toBase62());
console.log(generator.info(id));

Use a distinct machine ID for each concurrent generator. The format is custom; choose a standard UUID when your storage or integrations require UUID compatibility. IDs identify records; application authorization controls access to them.

Released under the MIT License.