mirror of
https://github.com/nbd-wtf/nostr-tools.git
synced 2025-12-08 16:28:49 +00:00
fix: CJK characters are garbled after decryption
This commit is contained in:
2
nip04.js
2
nip04.js
@@ -29,7 +29,7 @@ export function decrypt(privkey, pubkey, ciphertext) {
|
||||
Buffer.from(normalizedKey, 'hex'),
|
||||
Buffer.from(iv, 'base64')
|
||||
)
|
||||
let decryptedMessage = decipher.update(cip, 'base64')
|
||||
let decryptedMessage = decipher.update(cip, 'base64', 'utf8')
|
||||
decryptedMessage += decipher.final('utf8')
|
||||
|
||||
return decryptedMessage
|
||||
|
||||
Reference in New Issue
Block a user