agentsclimarketplace

Uuid v7 rfc 9562 generation

Skill kjuhwa/skills-hub/skills/architecture/uuid-v7-rfc-9562-generation

Generate RFC 9562 compliant UUIDv7 with millisecond timestamp prefix for sortabilityFrom its SKILL.md

Install
npx -y skills add kjuhwa/skills-hub --skill uuid-v7-rfc-9562-generation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

1.4 KB, 285 tokens by cl100k_base, as published. Nobody here has run it

UUIDv7 (RFC 9562) generator

UUIDv7 puts a 48-bit millisecond timestamp in the high bits, the version nibble in bits 48–51, and random bits everywhere else. IDs generated at different times sort lexicographically by time — ideal for append-only logs, outbox tables, and file naming.

Mechanism

function uuidv7() {
  const ms = Date.now();
  const hex = ms.toString(16).padStart(12, '0');
  const rnd = crypto.randomBytes(10);
  rnd[0] = (rnd[0] & 0x0f) | 0x70;       // version 7
  rnd[2] = (rnd[2] & 0x3f) | 0x80;       // variant 10
  const r = rnd.toString('hex');
  return `${hex.slice(0,8)}-${hex.slice(8,12)}-${r.slice(0,4)}-${r.slice(4,8)}-${r.slice(8,20)}`;
}

When to reuse

  • Message/event IDs where chronological sort matters.
  • Replacing ULID or Date.now()+nonce ad-hoc schemes.
  • Any ID space where a DB sequence is undesirable (distributed systems, file-based stores).

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 326,750. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.