UNPKG

discreetly-interfaces

Version:

Common interfaces and utilities for discreetly

23 lines (22 loc) 991 B
export declare function str2BigInt(str: string): bigint; /** * @description Generates a room ID from a server ID and room name * @param serverID : bigint | string | number * @param roomName : bigint | string | number * @returns roomId : bigint */ export declare function genId(serverID: string | bigint | number, roomName: string | bigint | number): bigint; export declare function randomBigInt(bits?: number): bigint; /** * @description Hashes the identity commitment and user message limit into the rate commitment * @param identityCommitment Semaphore Identity Commitment * @param userMessageLimit Number of messages a user can send per RLN epoch * @returns rlnRateCommitment */ export declare function getRateCommitmentHash(identityCommitment: bigint, userMessageLimit: number | bigint): bigint; /** * Hashes a signal string with Keccak256. * @param signal The RLN signal. * @returns The signal hash. */ export declare function calculateSignalHash(signal: string): bigint;