From 0e303e6508edb4374213d1f98ec383b266339774 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Sun, 18 May 2025 14:13:04 -0400 Subject: sync --- js/src/id/id.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'js/src/id') diff --git a/js/src/id/id.ts b/js/src/id/id.ts index e4744f172..39ee5326f 100644 --- a/js/src/id/id.ts +++ b/js/src/id/id.ts @@ -1,4 +1,4 @@ -import { z } from "zod"; +import { z } from "zod/v4"; import { randomBytes } from "crypto"; export namespace Identifier { @@ -11,7 +11,7 @@ export namespace Identifier { return z.string().startsWith(prefixes[prefix]); } - const LENGTH = 24; + const LENGTH = 26; export function ascending(prefix: keyof typeof prefixes, given?: string) { return generateID(prefix, false, given); @@ -45,6 +45,11 @@ export namespace Identifier { const randLength = (LENGTH - 12) / 2; const random = randomBytes(randLength); - return prefix + "_" + timeBytes.toString("hex") + random.toString("hex"); + return ( + prefixes[prefix] + + "_" + + timeBytes.toString("hex") + + random.toString("hex") + ); } } -- cgit v1.2.3