@hazae41/base58
Version:
Base58 adapter for WebAssembly and JS implementations
19 lines (16 loc) • 490 B
JavaScript
import { Copied } from '../../libs/copiable/index.mjs';
function fromScure(scure) {
const { base58 } = scure;
function getBytes(bytes) {
return "bytes" in bytes ? bytes.bytes : bytes;
}
function encodeOrThrow(bytes) {
return base58.encode(getBytes(bytes));
}
function decodeOrThrow(text) {
return new Copied(base58.decode(text));
}
return { encodeOrThrow, decodeOrThrow };
}
export { fromScure };
//# sourceMappingURL=scure.mjs.map