Skip to content

Commit

Permalink
chore: add sign message demo for noAuxRand
Browse files Browse the repository at this point in the history
  • Loading branch information
witter-deland committed Nov 14, 2024
1 parent acb30f6 commit 5147033
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wasm/examples/nodejs/javascript/general/message-signing.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ let message = 'Hello Kaspa!';
let privkey = 'b7e151628aed2a6abf7158809cf4f3c762e7160f38b4da56a784d9045190cfef';
let pubkey = 'dff1d77f2a671c5f36183726db2341be58feae1da2deced843240f7b502ba659';

function runDemo(message, privateKey, publicKey) {
let signature = signMessage({message, privateKey});
function runDemo(message, privateKey, publicKey, noAuxRand) {
let signature = signMessage({message, privateKey, noAuxRand});

console.info(`Message: ${message} => Signature: ${signature}`);

Expand All @@ -26,5 +26,7 @@ function runDemo(message, privateKey, publicKey) {

// Using strings:
runDemo(message, privkey, pubkey);
runDemo(message, privkey, pubkey, true);
// Using Objects:
runDemo(message, new PrivateKey(privkey), new PublicKey(pubkey));
runDemo(message, new PrivateKey(privkey), new PublicKey(pubkey), true);

0 comments on commit 5147033

Please sign in to comment.