Browse Source

rename accessKey to key

Kieran Gibb 3 years ago
parent
commit
79aea77350
No account linked to committer's email address
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      index.js

+ 5
- 5
index.js View File

@@ -26,11 +26,11 @@ class Crypto {
26 26
     return accessKey
27 27
   }
28 28
 
29
-  unpack (accessKey) {
30
-    if (accessKey.length < sodium.crypto_sign_PUBLICKEYBYTES) throw new Error('Invalid key length')
31
-    if (accessKey.length === sodium.crypto_sign_PUBLICKEYBYTES) return { publicKey: accessKey }
32
-    const publicKey = accessKey.slice(0, sodium.crypto_sign_PUBLICKEYBYTES)
33
-    const symmetricKey = accessKey.slice(sodium.crypto_secretbox_KEYBYTES)
29
+  unpack (key) {
30
+    if (key.length < sodium.crypto_sign_PUBLICKEYBYTES) throw new Error('Invalid key length')
31
+    if (key.length === sodium.crypto_sign_PUBLICKEYBYTES) return { publicKey: key }
32
+    const publicKey = key.slice(0, sodium.crypto_sign_PUBLICKEYBYTES)
33
+    const symmetricKey = key.slice(sodium.crypto_secretbox_KEYBYTES)
34 34
     return { publicKey, symmetricKey }
35 35
   }
36 36