UNPKG

@jovijovi/two-fa.js

Version:

A two-factor authentication(2FA) based on HOTP & TOTP written in TypeScript

20 lines 609 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DefaultHashFunc = exports.HashFunc = void 0; const crypto_1 = require("crypto"); const defaultHashAlg = 'sha1'; class HashFunc { Hash(msg) { const provider = this.Provider(); provider.update(msg); return provider.digest(); } } exports.HashFunc = HashFunc; function DefaultHashFunc() { const hashFunc = new HashFunc(); hashFunc.Provider = () => (0, crypto_1.createHash)(defaultHashAlg); return hashFunc; } exports.DefaultHashFunc = DefaultHashFunc; //# sourceMappingURL=hash.js.map