@jovijovi/two-fa.js
Version:
A two-factor authentication(2FA) based on HOTP & TOTP written in TypeScript
18 lines • 724 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Decode = exports.Encode = void 0;
const base32_encode_1 = __importDefault(require("base32-encode"));
const base32_decode_1 = __importDefault(require("base32-decode"));
const defaultRFC = 'RFC4648';
function Encode(data) {
return (0, base32_encode_1.default)(Uint8Array.from(Buffer.from(data)), defaultRFC, { padding: false });
}
exports.Encode = Encode;
function Decode(val) {
return (0, base32_decode_1.default)(val, defaultRFC);
}
exports.Decode = Decode;
//# sourceMappingURL=base32.js.map