Skip to content

Commit 8cc0c9f

Browse files
committed
chore(crypto): add doc for the generateIv function
1 parent 3f0dad5 commit 8cc0c9f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/lib/crypto.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
const crypto = require('crypto');
22

3+
const algorithm = 'AES-256-GCM';
4+
5+
/**
6+
* Generate an Initialization Vector
7+
* @returns {Buffer}
8+
*/
39
function generateIv() {
410
return crypto.randomBytes(32);
511
}
612

7-
const algorithm = 'AES-256-GCM';
8-
913
/**
1014
* Encrypt a secret
1115
* @param {String} data Data to encrypt

0 commit comments

Comments
 (0)