Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getId = transactionBytes => {
const transactionHash = hash(transactionBytes);
const bufferFromFirstEntriesReversed = getFirstEightBytesReversed(
transactionHash,
);
const transactionId = bufferToIntAsString(bufferFromFirstEntriesReversed);
return transactionId;
};
export const getTransactionId = (transaction: TransactionJSON): string => {
const transactionBytes = getTransactionBytes(transaction);
const transactionHash = cryptography.hash(transactionBytes);
const bufferFromFirstEntriesReversed = cryptography.getFirstEightBytesReversed(
transactionHash,
);
const firstEntriesToNumber = cryptography.bufferToIntAsString(
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;
};