Skip to content

Libraries

Terminal window
npm install puidv7
import { generateId, encodeId, decodeId } from 'puidv7';
// Generate a new puidv7
const id = generateId('acc');
// => acc06bgm7733st2576nx5jht4ecjw
// Convert existing UUIDv7 to puidv7
const puidv7 = encodeId('01970a1c-e31e-7422-9cd5-e9651d11cc97', 'acc');
// Convert puidv7 back to UUIDv7
const uuid = decodeId('acc06bgm7733st2576nx5jht4ecjw', 'acc');
View on GitHub →
Terminal window
go get github.com/puidv7/puidv7-go
View on GitHub →

Generate puidv7 identifiers directly in your infrastructure-as-code. Works with OpenTofu and Terraform.

terraform {
required_providers {
puidv7 = {
source = "puidv7/puidv7"
}
}
}
resource "puidv7_id" "account" {
prefix = "acc"
}
output "account_id" {
value = puidv7_id.account.id
}
# => acc06bgm7733st2576nx5jht4ecjw

View on Terraform Registry → · View on GitHub →