Closed gitmachtl closed 1 year ago
Can someone tell me what i am doing wrong here in nodejs?
const ed25519 = require('@noble/ed25519'); const prvKey = Uint8Array.from(Buffer.from('e8ddb1cfc09e163915e6c28fcb5fbb563bfef57201857e15288b67abbd91e444','hex')) console.log(prvKey) const pubKey = Uint8Array.from(Buffer.from('57758911253f6b31df2a87c10eb08a2c9b8450768cb8dd0d378d93f7c2e220f0','hex')) console.log(pubKey) function sharedSecret(prvKey,pubKey) { return ed25519.getSharedSecret(prvKey,pubKey) .then(result => { console.log(result); // Logs the result return response; } ); } console.log(sharedSecret(prvKey,pubKey));
I always get Promise { <pending> } as the output.
Promise { <pending> }
Best regards, Martin
You have two logs. See how promises work.
Can someone tell me what i am doing wrong here in nodejs?
I always get
Promise { <pending> }
as the output.Best regards, Martin