UNPKG

gamemoney-fix

Version:
18 lines (17 loc) 774 B
/// <reference types="node" /> import crypto from 'node:crypto'; export declare type RsaKey = Parameters<crypto.Sign['sign']>[0]; export declare type HmacKey = Parameters<typeof crypto.createHmac>[1]; declare type JsonPrimitive = number | number[] | string | string[] | undefined | null; declare type Json = { [key: string]: Json | JsonPrimitive; }; interface Body extends Json { signature: string; } export declare function parametersToString(body: Json): string; export declare function verifyRsaSignature(body: Body): boolean; export declare function generateRsaSignature(body: Json, key: RsaKey): string; export declare function generateHmacSignature(body: Json, key: HmacKey): string; export declare function getRandomString(length: number): string; export {};