@glandjs/common
Version:
Glands is a web framework for Node.js (@common)
25 lines (24 loc) • 739 B
TypeScript
export type UUID = string;
type BufferLike = Uint8Array | Buffer;
type UUIDOptions = {
buffer?: BufferLike;
offset?: number;
random?: BufferLike;
rng?: () => BufferLike;
};
export declare class CryptoUUID {
private static readonly VERSION;
private static readonly VARIANT;
private static readonly POOL_SIZE;
private static pool;
private static poolPtr;
static generate(options?: UUIDOptions): UUID;
static generate<T extends BufferLike>(options: UUIDOptions, buffer: T): T;
static validate(uuid: string | BufferLike): boolean;
private static getEntropy;
private static format;
private static hex;
private static validateBuffer;
private static isValidBuffer;
}
export {};