UNPKG

@ltonetwork/http-message-signatures

Version:

Implementation of the IETF HTTP Message Signatures draft standard

15 lines 573 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.encode = encode; exports.decode = decode; function encode(buffer) { return typeof Buffer !== 'undefined' ? (buffer instanceof Buffer ? buffer : Buffer.from(buffer)).toString('base64') : btoa(String.fromCharCode.apply(null, Array.from(buffer))); } function decode(message) { return typeof Buffer !== 'undefined' ? Buffer.from(message, 'base64').valueOf() : Uint8Array.from(atob(message), (c) => c.charCodeAt(0)); } //# sourceMappingURL=base64.js.map