You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**buffer** - data for encrypting, may be string, Buffer, or any object/array. Arrays and objects will encoded to JSON string first.<br/>
86
87
**encoding** - encoding for output result, may be 'buffer', 'binary', 'hex' or 'base64'. Default *buffer*.
87
-
**source_encoding** - source encoding, works only with string buffer. Can take standard Node.js Buffer encodings (hex, utf8, base64, etc). *Utf8* by default.<br/>
88
+
**source_encoding** - source encoding, works only with string buffer. Can take standard Node.js Buffer encodings (hex, utf8, base64, etc). *'utf8'* by default.<br/>
88
89
89
90
```js
90
91
key.decrypt(buffer, [encoding]);
91
92
```
93
+
Return decrypted data.<br/>
92
94
**buffer** - data for decrypting. Takes Buffer object or base64 encoded string.<br/>
93
-
**encoding** - encoding for result string. Can also take 'buffer' for raw Buffer object, or 'json' for automatic JSON.parse result. Default 'buffer'.
95
+
**encoding** - encoding for result string. Can also take 'buffer' for raw Buffer object, or 'json' for automatic JSON.parse result. Default *'buffer*.
94
96
95
97
### Signing/Verifying
98
+
```js
99
+
key.sign(buffer, [encoding], [source_encoding]);
100
+
```
101
+
Return signature for data. All the arguments are the same as for `encrypt` method.
0 commit comments