From 471cd46626e43a285d371a993398f68aae4fe04d Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Wed, 28 Jun 2023 23:19:14 +0000 Subject: [PATCH] readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 359cc1d..d60f748 100644 --- a/README.md +++ b/README.md @@ -149,9 +149,9 @@ const key = randomBytes(32); const data = utf8ToBytes('hello, noble'); // strings must be converted to Uint8Array const nonce = randomBytes(24); -const stream_x = xsalsa20_poly1305(key, nonce); -const ciphertext = stream_x.encrypt(data); -const plaintext = stream_x.decrypt(ciphertext); // === data +const stream_x = xsalsa20_poly1305(key, nonce); // === secretbox(key, nonce) +const ciphertext = stream_x.encrypt(data); // === secretbox.seal(data) +const plaintext = stream_x.decrypt(ciphertext); // === secretbox.open(ciphertext) // We provide sodium secretbox alias, which is just xsalsa20_poly1305 const box = secretbox(key, nonce);