@digitaldefiance/node-ecies-lib 4.10.8 → 4.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitaldefiance/node-ecies-lib",
3
- "version": "4.10.8",
3
+ "version": "4.11.2",
4
4
  "description": "Digital Defiance Node ECIES Library",
5
5
  "homepage": "https://github.com/Digital-Defiance/node-ecies-lib",
6
6
  "repository": {
@@ -62,7 +62,7 @@
62
62
  "license": "MIT",
63
63
  "packageManager": "yarn@4.10.3",
64
64
  "dependencies": {
65
- "@digitaldefiance/ecies-lib": "4.10.8",
65
+ "@digitaldefiance/ecies-lib": "4.11.1",
66
66
  "@digitaldefiance/express-suite-test-utils": "1.0.14",
67
67
  "@digitaldefiance/i18n-lib": "3.8.16",
68
68
  "@ethereumjs/wallet": "^10.0.0",
@@ -0,0 +1,80 @@
1
+ import type { Base64Guid, BigIntGuid, FullHexGuid, IGuid as IGuidBase, ShortHexGuid } from '@digitaldefiance/ecies-lib';
2
+ import type { RawGuidPlatformBuffer } from '../types';
3
+ import type { PlatformBuffer } from './platform-buffer';
4
+ export interface IGuidV4 extends IGuidBase {
5
+ /**
6
+ * Returns the GUID as a raw buffer.
7
+ */
8
+ get asRawGuidPlatformBuffer(): RawGuidPlatformBuffer;
9
+ /**
10
+ * Returns the GUID as a full hex string.
11
+ */
12
+ get asFullHexGuid(): FullHexGuid;
13
+ /**
14
+ * Returns the GUID as a Buffer.
15
+ */
16
+ get asPlatformBuffer(): PlatformBuffer;
17
+ /**
18
+ * Returns the GUID as a short hex string.
19
+ */
20
+ get asShortHexGuid(): ShortHexGuid;
21
+ /**
22
+ * Returns the GUID as a BigInt.
23
+ */
24
+ get asBigIntGuid(): BigIntGuid;
25
+ /**
26
+ * Returns the GUID as a Base64 string.
27
+ */
28
+ get asBase64Guid(): Base64Guid;
29
+ /**
30
+ * Returns the GUID as a base64 string
31
+ */
32
+ serialize(): string;
33
+ /**
34
+ * Returns the GUID as a JSON string
35
+ */
36
+ toJson(): string;
37
+ /**
38
+ * Returns the GUID as a Base64 string
39
+ */
40
+ toString(): Base64Guid;
41
+ /**
42
+ * Compares this GUID to another GUID
43
+ * @param other The GUID to compare to (can be null/undefined)
44
+ * @param constantTime Use constant-time comparison to prevent timing attacks
45
+ */
46
+ equals(other: IGuidV4 | null | undefined, constantTime?: boolean): boolean;
47
+ /**
48
+ * Creates a new GuidV4 instance with the same value as this one.
49
+ * @returns A new GuidV4 instance with identical value
50
+ */
51
+ clone(): IGuidV4;
52
+ /**
53
+ * Returns the hash code for this GUID based on its buffer content.
54
+ * Useful for using GUIDs as Map/Set keys.
55
+ * @returns A numeric hash code
56
+ */
57
+ hashCode(): number;
58
+ /**
59
+ * Checks if this GUID is empty (all zeros).
60
+ * @returns True if the GUID is all zeros, false otherwise
61
+ */
62
+ isEmpty(): boolean;
63
+ /**
64
+ * Extracts the RFC 4122 version from the GUID.
65
+ * @returns The version number (1-5) or undefined
66
+ */
67
+ getVersion(): number | undefined;
68
+ /**
69
+ * Validates that this GUID is a proper v4 GUID according to RFC 4122.
70
+ * @returns True if valid v4 GUID or boundary value, false otherwise
71
+ */
72
+ isValidV4(): boolean;
73
+ /**
74
+ * Compares two GUIDs for ordering.
75
+ * @param other The other GUID to compare to
76
+ * @returns -1 if this < other, 0 if equal, 1 if this > other
77
+ */
78
+ compareTo(other: IGuidV4): number;
79
+ }
80
+ //# sourceMappingURL=guid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guid.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/guid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,KAAK,IAAI,SAAS,EAClB,YAAY,EACb,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,WAAW,OAAQ,SAAQ,SAAS;IACxC;;OAEG;IACH,IAAI,uBAAuB,IAAI,qBAAqB,CAAC;IACrD;;OAEG;IACH,IAAI,aAAa,IAAI,WAAW,CAAC;IACjC;;OAEG;IACH,IAAI,gBAAgB,IAAI,cAAc,CAAC;IACvC;;OAEG;IACH,IAAI,cAAc,IAAI,YAAY,CAAC;IACnC;;OAEG;IACH,IAAI,YAAY,IAAI,UAAU,CAAC;IAC/B;;OAEG;IACH,IAAI,YAAY,IAAI,UAAU,CAAC;IAE/B;;OAEG;IACH,SAAS,IAAI,MAAM,CAAC;IACpB;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC;IACjB;;OAEG;IACH,QAAQ,IAAI,UAAU,CAAC;IACvB;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC3E;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC;IACjB;;;;OAIG;IACH,QAAQ,IAAI,MAAM,CAAC;IACnB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC;IACnB;;;OAGG;IACH,UAAU,IAAI,MAAM,GAAG,SAAS,CAAC;IACjC;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC;CACnC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=guid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guid.js","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/interfaces/guid.ts"],"names":[],"mappings":""}
@@ -0,0 +1,420 @@
1
+ import { Base64Guid, BigIntGuid, FullHexGuid, GuidBrandType, GuidInput, IGuid, ShortHexGuid } from '@digitaldefiance/ecies-lib';
2
+ import { PlatformBuffer } from '../interfaces';
3
+ import { RawGuidPlatformBuffer } from '../types';
4
+ /**
5
+ * Guid represents a GUID (Globally Unique Identifier) that is compliant with the RFC 4122 standard.
6
+ * Guid instances can be created from a variety of input types, including:
7
+ * - FullHexGuid: A 36-character string representation of the GUID, including dashes
8
+ * - ShortHexGuid: A 32-character string representation of the GUID, excluding dashes
9
+ * - Base64Guid: A 24-character base64-encoded string representation of the GUID
10
+ * - BigIntGuid: A bigint representation of the GUID
11
+ * - RawGuidPlatformBuffer: A 16-byte Buffer representation of the GUID
12
+ * Guid instances can be converted to any of these representations using the appropriate method.
13
+ */
14
+ export declare class Guid implements IGuid {
15
+ /**
16
+ * GUID is stored internally as a raw 16-byte Buffer.
17
+ */
18
+ private readonly _value;
19
+ /**
20
+ * Boundary value constants for special GUID validation
21
+ */
22
+ private static readonly BOUNDARY_VALUES;
23
+ /**
24
+ * Maximum valid bigint value for a 128-bit GUID
25
+ */
26
+ private static readonly MAX_BIGINT_VALUE;
27
+ /**
28
+ * Cached full hex representation for performance
29
+ */
30
+ private _cachedFullHex?;
31
+ /**
32
+ * Cached short hex representation for performance
33
+ */
34
+ private _cachedShortHex?;
35
+ /**
36
+ * Cached base64 representation for performance
37
+ */
38
+ private _cachedBase64?;
39
+ /**
40
+ * Regex for validating hex strings (case insensitive)
41
+ */
42
+ private static readonly HEX_PATTERN;
43
+ /**
44
+ * Regex for validating full hex GUID format
45
+ */
46
+ private static readonly FULL_HEX_PATTERN;
47
+ /**
48
+ * Type guard to check if a value is a Buffer
49
+ */
50
+ private static isBuffer;
51
+ /**
52
+ * Type guard to check if a value is a Buffer or Uint8Array
53
+ */
54
+ private static isBufferLike;
55
+ /**
56
+ * Cached empty/nil GUID constant (all zeros)
57
+ */
58
+ private static _empty?;
59
+ /**
60
+ * Empty/nil GUID constant (all zeros)
61
+ */
62
+ static get Empty(): Guid;
63
+ constructor(value: GuidInput);
64
+ /**
65
+ * Validates input and converts to raw buffer with comprehensive error handling.
66
+ * This centralizes all validation logic for better maintainability.
67
+ * @param value The input value to validate and convert
68
+ * @returns The validated raw GUID buffer
69
+ * @throws {GuidError} If validation fails
70
+ */
71
+ private static validateAndConvert;
72
+ static validateUuid(value: string): boolean;
73
+ serialize(): string;
74
+ static hydrate(value: string): Guid;
75
+ private static readonly LengthMap;
76
+ private static readonly ReverseLengthMap;
77
+ private static readonly VerifyFunctions;
78
+ /**
79
+ * Returns the GUID as a raw Buffer.
80
+ * NOTE: Returns a defensive copy to prevent external mutation.
81
+ * Use asRawGuidPlatformBufferUnsafe() if you need the internal buffer and guarantee no mutation.
82
+ */
83
+ get asRawGuidPlatformBuffer(): RawGuidPlatformBuffer;
84
+ /**
85
+ * Returns the internal raw Buffer without copying.
86
+ * ⚠️ WARNING: Do NOT mutate the returned buffer! This is for performance-critical paths only.
87
+ * Mutating this buffer will corrupt the GUID instance.
88
+ * @internal
89
+ */
90
+ get asRawGuidPlatformBufferUnsafe(): RawGuidPlatformBuffer;
91
+ /**
92
+ * Generates a new random v4 GUID.
93
+ * @returns A new Guid instance with a randomly generated value
94
+ */
95
+ static generate(): Guid;
96
+ /**
97
+ * Alias for generate() to create a v4 GUID.
98
+ * @returns A new Guid instance with a randomly generated v4 value
99
+ */
100
+ static v4(): Guid;
101
+ /**
102
+ * Alias for generate() for backward compatibility.
103
+ * @deprecated Use generate() instead for clearer intent
104
+ */
105
+ static new(): Guid;
106
+ /**
107
+ * Parses a GUID from any valid format, throwing on invalid input.
108
+ * This is the primary parsing method for when you expect valid input.
109
+ * @param value The value to parse
110
+ * @returns A new Guid instance
111
+ * @throws {GuidError} If the value is not a valid GUID
112
+ */
113
+ static parse(value: GuidInput): Guid;
114
+ /**
115
+ * Attempts to parse a GUID, returning null on failure instead of throwing.
116
+ * Use this when you're uncertain if the input is valid.
117
+ * @param value The value to parse
118
+ * @returns A new Guid instance or null if parsing fails
119
+ */
120
+ static tryParse(value: GuidInput): Guid | null;
121
+ /**
122
+ * Validates whether a value is a valid GUID without creating an instance.
123
+ * More efficient than tryParse when you only need validation.
124
+ * @param value The value to validate
125
+ * @returns True if valid, false otherwise
126
+ */
127
+ static isValid(value: unknown): boolean;
128
+ /**
129
+ * Factory method to create a GUID from a full hex string.
130
+ * @param fullHex The full hex string (with dashes)
131
+ * @returns A new Guid instance
132
+ */
133
+ static fromFullHex(fullHex: string): Guid;
134
+ /**
135
+ * Factory method to create a GUID from a short hex string.
136
+ * @param shortHex The short hex string (without dashes)
137
+ * @returns A new Guid instance
138
+ */
139
+ static fromShortHex(shortHex: string): Guid;
140
+ /**
141
+ * Factory method to create a GUID from a base64 string.
142
+ * @param base64 The base64 encoded string
143
+ * @returns A new Guid instance
144
+ */
145
+ static fromBase64(base64: string): Guid;
146
+ /**
147
+ * Factory method to create a GUID from a bigint.
148
+ * @param bigint The bigint value
149
+ * @returns A new Guid instance
150
+ */
151
+ static fromBigInt(bigint: bigint): Guid;
152
+ /**
153
+ * Factory method to create a GUID from a raw buffer.
154
+ * @param buffer The raw 16-byte buffer
155
+ * @returns A new Guid instance
156
+ */
157
+ static fromBuffer(buffer: Buffer): Guid;
158
+ /**
159
+ * Factory method to create a GUID from a raw Uint8Array.
160
+ * This converts the Uint8Array to a Buffer first.
161
+ * @param bytes The raw 16-byte Uint8Array
162
+ * @returns A new Guid instance
163
+ */
164
+ static fromUint8Array(bytes: Uint8Array): Guid;
165
+ /**
166
+ * Creates a namespace-based v3 GUID (MD5 hash).
167
+ * Use this for deterministic GUIDs based on a namespace and name.
168
+ * @param namespace The namespace GUID (e.g., uuid.v3.DNS)
169
+ * @param name The name to hash within the namespace
170
+ * @returns A new Guid instance containing the v3 GUID
171
+ * @example
172
+ * const guid = Guid.v3('example.com', uuid.v3.DNS);
173
+ */
174
+ static v3(name: string, namespace: string | Buffer): Guid;
175
+ /**
176
+ * Creates a namespace-based v5 GUID (SHA-1 hash).
177
+ * Use this for deterministic GUIDs based on a namespace and name.
178
+ * Preferred over v3 as SHA-1 is stronger than MD5.
179
+ * @param namespace The namespace GUID (e.g., uuid.v5.DNS)
180
+ * @param name The name to hash within the namespace
181
+ * @returns A new Guid instance containing the v5 GUID
182
+ * @example
183
+ * const guid = Guid.v5('example.com', uuid.v5.DNS);
184
+ */
185
+ static v5(name: string, namespace: string | Buffer): Guid;
186
+ /**
187
+ * Common namespace constants for use with v3/v5 GUIDs.
188
+ * These are the standard RFC 4122 namespace UUIDs, defined inline for browser compatibility.
189
+ * (Avoids issues with uuid library's namespace exports in some bundler configurations)
190
+ */
191
+ static readonly Namespaces: {
192
+ /** DNS namespace UUID per RFC 4122 */
193
+ readonly DNS: "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
194
+ /** URL namespace UUID per RFC 4122 */
195
+ readonly URL: "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
196
+ };
197
+ /**
198
+ * Returns the GUID as a full hex string.
199
+ * Result is cached for performance.
200
+ */
201
+ get asFullHexGuid(): FullHexGuid;
202
+ /**
203
+ * Returns the GUID as a raw Buffer.
204
+ */
205
+ get asBuffer(): Buffer;
206
+ /**
207
+ * Returns the GUID as a native Uint8Array (not a Buffer).
208
+ */
209
+ get asUint8Array(): Uint8Array;
210
+ /**
211
+ * Returns the GUID as a short hex string.
212
+ * Result is cached for performance.
213
+ */
214
+ get asShortHexGuid(): ShortHexGuid;
215
+ /**
216
+ * Returns the GUID as a base64 string.
217
+ */
218
+ toString(): Base64Guid;
219
+ /**
220
+ * Returns the GUID as a JSON string.
221
+ * @returns The GUID as a JSON string.
222
+ */
223
+ toJson(): string;
224
+ /**
225
+ * Returns the GUID as a bigint.
226
+ */
227
+ get asBigIntGuid(): BigIntGuid;
228
+ /**
229
+ * Returns the GUID as a base64 string.
230
+ * Result is cached for performance.
231
+ */
232
+ get asBase64Guid(): Base64Guid;
233
+ get asPlatformBuffer(): PlatformBuffer;
234
+ /**
235
+ * Checks if a GUID value is a boundary value (all zeros or all Fs).
236
+ * @param value The GUID value to check.
237
+ * @returns True if the value is a boundary value.
238
+ */
239
+ private static isBoundaryValue;
240
+ /**
241
+ * Verifies if a given GUID is valid for the given brand.
242
+ * @param guidBrand The brand of the GUID to verify.
243
+ * @param guid The GUID to verify.
244
+ * @returns True if the GUID is valid for the given brand, false otherwise.
245
+ */
246
+ static verifyGuid(guidBrand: GuidBrandType, guid: GuidInput): boolean;
247
+ /**
248
+ * Returns the length of the GUID for the given brand.
249
+ * @param guidBrand The brand of the GUID to get the length for.
250
+ * @returns The length of the GUID for the given brand.
251
+ */
252
+ static guidBrandToLength(guidBrand: GuidBrandType): number;
253
+ /**
254
+ * Returns the brand of the GUID for the given length.
255
+ * @param length The length of the GUID to get the brand for.
256
+ * @param isBuffer Whether the GUID is a Buffer.
257
+ * @returns The brand of the GUID for the given length.
258
+ */
259
+ static lengthToGuidBrand(length: number, isBuffer: boolean): GuidBrandType;
260
+ /**
261
+ * Verifies if a given GUID is a valid full hex GUID.
262
+ * @param fullHexGuidValue The full hex GUID to verify.
263
+ * @returns True if the GUID is a valid full hex GUID, false otherwise.
264
+ */
265
+ static isFullHexGuid(fullHexGuidValue: GuidInput): boolean;
266
+ /**
267
+ * Verifies if a given GUID is a valid short hex GUID.
268
+ * @param shortHexGuidValue The short hex GUID to verify.
269
+ * @returns True if the GUID is a valid short hex GUID, false otherwise.
270
+ */
271
+ static isShortHexGuid(shortHexGuidValue: GuidInput): boolean;
272
+ /**
273
+ * Verifies if a given GUID is a valid base64 GUID.
274
+ * @param value The base64 GUID to verify.
275
+ * @returns True if the GUID is a valid base64 GUID, false otherwise.
276
+ */
277
+ static isBase64Guid(value: GuidInput): boolean;
278
+ /**
279
+ * Verifies if a given GUID is a valid raw GUID buffer.
280
+ * @param value The raw GUID buffer to verify.
281
+ * @returns True if the GUID is a valid raw GUID buffer, false otherwise.
282
+ */
283
+ static isRawGuidPlatformBuffer(value: GuidInput): boolean;
284
+ /**
285
+ * Verifies if a given GUID is a valid bigint GUID.
286
+ * @param value The bigint GUID to verify.
287
+ * @returns True if the GUID is a valid bigint GUID, false otherwise.
288
+ */
289
+ static isBigIntGuid(value: GuidInput): boolean;
290
+ /**
291
+ * Determines the brand of a given GUID value.
292
+ * @param value The GUID value to determine the brand of.
293
+ * @returns The brand of the GUID value.
294
+ */
295
+ static whichBrand(value: GuidInput): GuidBrandType;
296
+ /**
297
+ * Converts a given short hex GUID to a full hex GUID.
298
+ * @param shortGuid The short hex GUID to convert.
299
+ * @returns The short hex GUID as a full hex GUID.
300
+ */
301
+ private static shortGuidToFullGuid;
302
+ /**
303
+ * Converts a given GUID value to a full hex GUID.
304
+ * @param guid The GUID value to convert.
305
+ * @returns The GUID value as a full hex GUID.
306
+ */
307
+ static toFullHexGuid(guid: RawGuidPlatformBuffer | BigIntGuid | Base64Guid | ShortHexGuid | FullHexGuid | string): FullHexGuid;
308
+ static toShortHexGuid(guid: RawGuidPlatformBuffer | BigIntGuid | Base64Guid | ShortHexGuid | FullHexGuid | string): ShortHexGuid;
309
+ /**
310
+ * Converts a given bigint to a full hex GUID.
311
+ * @param bigInt The bigint to convert.
312
+ * @returns The bigint as a full hex GUID.
313
+ */
314
+ static toFullHexFromBigInt(bigInt: bigint): FullHexGuid;
315
+ /**
316
+ * Converts a given GUID value to a raw GUID buffer.
317
+ * @param value The GUID value to convert.
318
+ * @returns The GUID value as a raw GUID buffer.
319
+ */
320
+ static toRawGuidPlatformBuffer(value: GuidInput): RawGuidPlatformBuffer;
321
+ /**
322
+ * Compare two Guid instances for equality.
323
+ * @param other - The other Guid instance to compare (can be null/undefined)
324
+ * @param constantTime - Use constant-time comparison to prevent timing attacks (default: false)
325
+ * @returns True if the two Guid instances are equal, false otherwise
326
+ */
327
+ equals(other: IGuid | null | undefined, constantTime?: boolean): boolean;
328
+ /**
329
+ * Checks if this GUID is empty (all zeros).
330
+ * @returns True if the GUID is all zeros, false otherwise
331
+ */
332
+ isEmpty(): boolean;
333
+ /**
334
+ * Static helper to check if a GUID is null, undefined, or empty.
335
+ * @param guid The GUID to check
336
+ * @returns True if the GUID is null, undefined, or empty
337
+ */
338
+ static isNilOrEmpty(guid: IGuid | null | undefined): boolean;
339
+ /**
340
+ * Creates a new Guid instance with the same value as this one.
341
+ * @returns A new Guid instance with identical value
342
+ */
343
+ clone(): Guid;
344
+ /**
345
+ * Returns the hash code for this GUID based on its buffer content.
346
+ * Useful for using GUIDs as Map/Set keys.
347
+ * @returns A numeric hash code
348
+ */
349
+ hashCode(): number;
350
+ /**
351
+ * Extracts the RFC 4122 version from the GUID.
352
+ * Returns undefined for boundary values or invalid GUIDs.
353
+ * @returns The version number (1-5) or undefined
354
+ */
355
+ getVersion(): number | undefined;
356
+ /**
357
+ * Validates that this GUID is a proper v3 GUID according to RFC 4122.
358
+ * @returns True if valid v3 GUID, false otherwise
359
+ */
360
+ isValidV3(): boolean;
361
+ /**
362
+ * Validates that this GUID is a proper v4 GUID according to RFC 4122.
363
+ * Boundary values (all zeros/all Fs) return true as they're mathematically valid.
364
+ * @returns True if valid v4 GUID or boundary value, false otherwise
365
+ */
366
+ isValidV4(): boolean;
367
+ /**
368
+ * Validates that this GUID is a proper v5 GUID according to RFC 4122.
369
+ * @returns True if valid v5 GUID, false otherwise
370
+ */
371
+ isValidV5(): boolean;
372
+ /**
373
+ * Returns a human-readable string representation.
374
+ */
375
+ toDebugString(): string;
376
+ /**
377
+ * Compares two GUIDs for ordering.
378
+ * Useful for sorting GUID arrays.
379
+ * @param other The other GUID to compare to
380
+ * @returns -1 if this < other, 0 if equal, 1 if this > other
381
+ */
382
+ compareTo(other: IGuid): number;
383
+ /**
384
+ * Returns the timestamp from a v1 GUID.
385
+ * @returns Date object or undefined if not a v1 GUID
386
+ */
387
+ getTimestamp(): Date | undefined;
388
+ /**
389
+ * Extracts the variant from the GUID.
390
+ * @returns The variant (0-2) or undefined
391
+ */
392
+ getVariant(): number | undefined;
393
+ /**
394
+ * Creates a v1 GUID (time-based).
395
+ * @returns A new Guid instance containing a v1 GUID
396
+ */
397
+ static v1(): Guid;
398
+ /**
399
+ * Validates that this GUID is a proper v1 GUID.
400
+ * @returns True if valid v1 GUID, false otherwise
401
+ */
402
+ isValidV1(): boolean;
403
+ /**
404
+ * Returns a URL-safe base64 representation (no padding, URL-safe chars).
405
+ */
406
+ get asUrlSafeBase64(): string;
407
+ /**
408
+ * Creates a GUID from URL-safe base64.
409
+ */
410
+ static fromUrlSafeBase64(urlSafe: string): Guid;
411
+ /**
412
+ * Alias for isRawGuidPlatformBuffer for backward compatibility
413
+ */
414
+ static isRawGuidBuffer: typeof Guid.isRawGuidPlatformBuffer;
415
+ /**
416
+ * Alias for toRawGuidPlatformBuffer for backward compatibility
417
+ */
418
+ static toRawGuidBuffer: typeof Guid.toRawGuidPlatformBuffer;
419
+ }
420
+ //# sourceMappingURL=guid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guid.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-node-ecies-lib/src/lib/guid.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,WAAW,EACX,aAAa,EAGb,SAAS,EACT,KAAK,EACL,YAAY,EACb,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;;;;;;GASG;AACH,qBAAa,IAAK,YAAW,KAAK;IAChC;;OAEG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwB;IAE/C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAK5B;IAEX;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAEtC;IAEF;;OAEG;IACH,OAAO,CAAC,cAAc,CAAC,CAAc;IAErC;;OAEG;IACH,OAAO,CAAC,eAAe,CAAC,CAAe;IAEvC;;OAEG;IACH,OAAO,CAAC,aAAa,CAAC,CAAa;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