You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creates a new `UUIDv7` instance. By default it uses the [Base58](https://www.cs.utexas.edu/users/moore/acl2/manuals/current/manual/index-seo.php/BITCOIN_____A2BASE58-CHARACTERS_A2) alphabet to `encode` and `decode` UUIDs, but you can pass a custom alphabet (16-64 characters).
Copy file name to clipboardexpand all lines: src/index.ts
+32-19
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,3 @@
1
-
importbaseXfrom"base-x";
2
-
3
1
functionaddHyphens(id: string){
4
2
return(
5
3
id.substring(0,8)+
@@ -30,13 +28,13 @@ export class UUIDv7 {
30
28
#lastRandA: number;
31
29
#lastRandB: bigint;
32
30
#lastUUID: bigint=-1n;
33
-
#encoder: baseX.BaseConverter;
31
+
#encodeAlphabet: string;
34
32
35
33
/**
36
34
* Generates a new `UUIDv7` instance.
37
35
* @param encodeAlphabet Alphabet used for encoding. Defaults to [Base58](https://www.cs.utexas.edu/users/moore/acl2/manuals/current/manual/index-seo.php/BITCOIN_____A2BASE58-CHARACTERS_A2) alphabet. 16-64 characters.
0 commit comments