otp-io
Version:
🕖 Typed library to work 2fa via Google Authenticator/Time-based TOTP/Hmac-based HOTP
14 lines (11 loc) • 302 B
text/typescript
export const HmacAlgorithm = Object.freeze({
SHA1: "sha1",
SHA256: "sha256",
SHA512: "sha512"
});
export type HmacAlgorithm = (typeof HmacAlgorithm)[keyof typeof HmacAlgorithm];
export type Hmac = (
algorithm: HmacAlgorithm,
key: Uint8Array,
message: Uint8Array
) => Promise<Uint8Array>;