Socket
Book a DemoInstallSign in
Socket

@lokalise/id-utils

Package Overview
Dependencies
Maintainers
16
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lokalise/id-utils

This package adds common utils that provide IDs compatible with CockroachDB UUID type.

3.0.1
latest
Source
npmnpm
Version published
Maintainers
16
Created
Source

Id generation utils

This package adds common utils that provide IDs compatible with CockroachDB UUID type.

Usage

import { generateMonotonicUuid } from '@lokalise/id-utils'

const newId = generateMonotonicUuid()

Provided ID conforms with an abstract UUID representation (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx) and is generated by ULID algorithm, which makes it lexicographically sortable. You can use basic language functions to sort by these ids:

import { generateMonotonicUuid } from '@lokalise/id-utils'

const ids = []

for (const i of Array(1000)) {
	ids.push(generateMonotonicUuid())
}

const sorted = ids.sort()

// sorted == ids

UUID7

This package also provides a function to generate a UUID7. It is a:

import { generateUuid7 } from '@lokalise/id-utils'

generateUuid7()

FAQs

Package last updated on 21 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.