UNPKG

xotp

Version:

One-Time Password (HOTP/TOTP) library for Node.js, Deno and Bun, with support for Google Authenticator.

20 lines (19 loc) 530 B
import { Algorithm, Encoding } from "./types"; export declare class Secret { #private; constructor(); constructor({ data }: { data: Buffer; }); constructor({ algorithm }: { algorithm: Algorithm; }); constructor({ size }: { size: number; }); get buffer(): Buffer<ArrayBufferLike>; static for(algorithm: Algorithm): Secret; static from(data: string, encoding?: Encoding): Secret; static from(data: Buffer): Secret; toString(encoding?: Encoding): string; }