We will be sunsetting Advisor during Jan, 2026 and will instead be providing information in Snyk Security DB.

You can begin to take advantage of Snyk Security DB today for a unified, package-centric experience.

How to use the @nimiq/core.Hash function in @nimiq/core

To help you get started, we’ve selected a few @nimiq/core 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 MatthewDLudwig / NimiqWrapper / releases / browser / NimiqWrapper.js View on Github external
verifyKeyguardSignature(signedMessage, rawMessage) {
		const signature = signedMessage.signature instanceof Nimiq.Signature ? signedMessage.signature : new Nimiq.Signature(signedMessage.signature);
		const publicKey = signedMessage.signerPublicKey instanceof Nimiq.PublicKey ? signedMessage.signerPublicKey : new Nimiq.PublicKey(signedMessage.signerPublicKey);

		const data = HubApi.MSG_PREFIX + rawMessage.length + rawMessage;
		const dataBytes = Nimiq.BufferUtils.fromUtf8(data);
		const hash = Nimiq.Hash.computeSha256(dataBytes);

		return signature.verify(publicKey, hash);
	}
github MatthewDLudwig / NimiqWrapper / releases / browser / NimiqWrapper.js View on Github external
getTransactionByHash(hash, callback) {
		if (this.theWrapper.nodeType == "FULL") {
			let finalHash = null;
			if (hash instanceof Nimiq.Hash) {
				finalHash = hash;
			} else if (typeof hash == "string") {
				finalHash = Nimiq.Hash.fromHex(hash.replace("0x", ""));
			}

			if (finalHash == null) {
				this.theWrapper.callbacks.error("UtilHelper:getTransactionByHash", NimiqWrapper.ERROR_MESSAGES.BAD_PARAM_TYPE);
			} else {
				this.theWrapper.wrappedNode.blockchain.getTransactionInfoByHash(finalHash).then((tx) => {
					let obj = {
						txHash : tx.transactionHash,
						blockHash : tx.blockHash,
						height : tx.blockHeight,
						index : tx.index,
						sender : tx.sender,
						recipient : tx.recipient
github MatthewDLudwig / NimiqWrapper / releases / browser / NimiqWrapper.js View on Github external
getTransactionByHash(hash, callback) {
		if (this.theWrapper.nodeType == "FULL") {
			let finalHash = null;
			if (hash instanceof Nimiq.Hash) {
				finalHash = hash;
			} else if (typeof hash == "string") {
				finalHash = Nimiq.Hash.fromHex(hash.replace("0x", ""));
			}

			if (finalHash == null) {
				this.theWrapper.callbacks.error("UtilHelper:getTransactionByHash", NimiqWrapper.ERROR_MESSAGES.BAD_PARAM_TYPE);
			} else {
				this.theWrapper.wrappedNode.blockchain.getTransactionInfoByHash(finalHash).then((tx) => {
					let obj = {
						txHash : tx.transactionHash,
						blockHash : tx.blockHash,
						height : tx.blockHeight,
						index : tx.index,
						sender : tx.sender,
						recipient : tx.recipient
					};

					callback(obj);