nostr-tools
Advanced tools
Comparing version 0.21.1 to 0.21.2
10
nip04.js
@@ -8,3 +8,3 @@ import aes from 'browserify-cipher' | ||
const key = secp256k1.getSharedSecret(privkey, '02' + pubkey) | ||
const normalizedKey = getOnlyXFromFullSharedSecret(key) | ||
const normalizedKey = getNormalizedX(key) | ||
@@ -26,3 +26,3 @@ let iv = Uint8Array.from(randomBytes(16)) | ||
let key = secp256k1.getSharedSecret(privkey, '02' + pubkey) | ||
let normalizedKey = getOnlyXFromFullSharedSecret(key) | ||
let normalizedKey = getNormalizedX(key) | ||
@@ -40,4 +40,6 @@ var decipher = aes.createDecipheriv( | ||
function getOnlyXFromFullSharedSecret(fullSharedSecretCoordinates) { | ||
return Buffer.from(fullSharedSecretCoordinates).toString('hex').substr(2, 64) | ||
function getNormalizedX(key) { | ||
return typeof key === 'string' | ||
? key.substr(2) | ||
: Buffer.from(key.slice(1)).toString('hex') | ||
} |
{ | ||
"name": "nostr-tools", | ||
"version": "0.21.1", | ||
"version": "0.21.2", | ||
"description": "Tools for making a Nostr client.", | ||
@@ -5,0 +5,0 @@ "repository": { |
655
22193