UNPKG

@ledgerhq/hw-app-near

Version:
13 lines 541 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.bip32PathToBytes = void 0; const bip32PathToBytes = (path) => { const parts = path.split("/"); return Buffer.concat(parts .map(part => part.endsWith("'") ? Math.abs(parseInt(part.slice(0, -1))) | 0x80000000 : Math.abs(parseInt(part))) .map(i32 => Buffer.from([(i32 >> 24) & 0xff, (i32 >> 16) & 0xff, (i32 >> 8) & 0xff, i32 & 0xff]))); }; exports.bip32PathToBytes = bip32PathToBytes; //# sourceMappingURL=utils.js.map