How to use the @liskhq/lisk-cryptography.getFirstEightBytesReversed function in @liskhq/lisk-cryptography

To help you get started, we’ve selected a few @liskhq/lisk-cryptography examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LiskArchive / lisk-elements / packages / lisk-blockchain / src / block.ts View on Github external
export const getBlockId = (blockBytes: Buffer) => {
	const blockHash = hash(blockBytes);
	const bufferFromFirstEntriesReversed = getFirstEightBytesReversed(blockHash);
	const firstEntriesToNumber = bufferToBigNumberString(
		bufferFromFirstEntriesReversed,
	);

	return firstEntriesToNumber;
};
github LiskHQ / lisk-sdk / elements / lisk-transactions / src / utils / transaction_id.ts View on Github external
export const getId = (transactionBytes: Buffer): string => {
	const transactionHash = cryptography.hash(transactionBytes);
	const bufferFromFirstEntriesReversed = cryptography.getFirstEightBytesReversed(
		transactionHash,
	);
	const transactionId = cryptography.bufferToIntAsString(
		bufferFromFirstEntriesReversed,
	);

	return transactionId;
};
github LiskHQ / lisk-sdk / protocol-specs / generators / multisignature / index.js View on Github external
const getId = transactionBytes => {
	const transactionHash = hash(transactionBytes);
	const bufferFromFirstEntriesReversed = getFirstEightBytesReversed(
		transactionHash,
	);
	const transactionId = bufferToIntAsString(bufferFromFirstEntriesReversed);

	return transactionId;
};
github LiskHQ / lisk-sdk / protocol-specs / generators / transaction_network_id_and_change_order / index.js View on Github external
const getId = transactionBytes => {
	const transactionHash = hash(transactionBytes);
	const bufferFromFirstEntriesReversed = getFirstEightBytesReversed(
		transactionHash,
	);
	const transactionId = bufferToIntAsString(bufferFromFirstEntriesReversed);

	return transactionId;
};