@synet/credential
Version:
VC Credentials - Simple, Robust, Unit-based Verifiable Credentials service
18 lines (17 loc) • 680 B
TypeScript
/**
* Generate a CUID2-like identifier using Node.js crypto
*
* This is a simplified, zero-dependency implementation of CUID2 concepts:
* - Uses native Node.js crypto instead of @noble/hashes
* - Maintains similar structure: letter + hash of (time + entropy + counter)
* - Provides collision-resistant, sortable, URL-safe IDs
*
* @param length - Length of the generated ID (default: 24)
* @returns A CUID2-like identifier string
*/
export declare function createId(length?: number): string;
/**
* Base64url encoding utilities (simplified)
*/
export declare function base64urlEncode(data: string): string;
export declare function base64urlDecode(data: string): string;