Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const getBlockId = (blockBytes: Buffer) => {
const blockHash = hash(blockBytes);
const bufferFromFirstEntriesReversed = getFirstEightBytesReversed(blockHash);
const firstEntriesToNumber = bufferToBigNumberString(
bufferFromFirstEntriesReversed,
);
return firstEntriesToNumber;
};
export const getId = (transactionBytes: Buffer): string => {
const transactionHash = cryptography.hash(transactionBytes);
const bufferFromFirstEntriesReversed = cryptography.getFirstEightBytesReversed(
transactionHash,
);
const transactionId = cryptography.bufferToIntAsString(
bufferFromFirstEntriesReversed,
);
return transactionId;
};
const getId = transactionBytes => {
const transactionHash = hash(transactionBytes);
const bufferFromFirstEntriesReversed = getFirstEightBytesReversed(
transactionHash,
);
const transactionId = bufferToIntAsString(bufferFromFirstEntriesReversed);
return transactionId;
};
const getId = transactionBytes => {
const transactionHash = hash(transactionBytes);
const bufferFromFirstEntriesReversed = getFirstEightBytesReversed(
transactionHash,
);
const transactionId = bufferToIntAsString(bufferFromFirstEntriesReversed);
return transactionId;
};