@ecash/lib
Version:
Library for eCash transaction building
19 lines • 710 B
JavaScript
;
// Copyright (c) 2024 The Bitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
Object.defineProperty(exports, "__esModule", { value: true });
exports.bytesToStr = exports.strToBytes = void 0;
const encoder = new TextEncoder();
const decoder = new TextDecoder();
/** Turn a UTF-8 encoded string into a Uint8Array */
function strToBytes(str) {
return encoder.encode(str);
}
exports.strToBytes = strToBytes;
/** Turn a Uint8Array into a UTF-8 encoded string */
function bytesToStr(bytes) {
return decoder.decode(bytes);
}
exports.bytesToStr = bytesToStr;
//# sourceMappingURL=str.js.map