UNPKG

@an00b1s/gamemoney

Version:
18 lines (17 loc) 773 B
/// <reference types="node" resolution-mode="require"/> import crypto from 'node:crypto'; export type RsaKey = Parameters<crypto.Sign['sign']>[0]; export type HmacKey = Parameters<typeof crypto.createHmac>[1]; type JsonPrimitive = number | number[] | string | string[] | undefined | null; export type Json = { [key: string]: Json | JsonPrimitive; }; export type Body = { signature: string; } & Json; 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 {};