Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @param {string} transactionPayload HexString Payload
- * @returns {*|string} Returns Transaction Payload hash
- */
- static createTransactionHash(transactionPayload) {
- const byteBuffer = Array.from(convert.hexToUint8(transactionPayload));
- const signingBytes = byteBuffer
- .slice(4, 36)
- .concat(byteBuffer
- .slice(4 + 64, 4 + 64 + 32))
- .concat(byteBuffer
- .splice(4 + 64 + 32, byteBuffer.length));
- const hash = new Uint8Array(32);
- sha3Hasher.func(hash, signingBytes, 32);
- return convert.uint8ToHex(hash);
- }
Add Comment
Please, Sign In to add comment