Skip to content

Commit

Permalink
chore(crypto): add doc for the generateIv function
Browse files Browse the repository at this point in the history
  • Loading branch information
timoa committed Apr 15, 2022
1 parent 3f0dad5 commit 8cc0c9f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/lib/crypto.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
const crypto = require('crypto');

const algorithm = 'AES-256-GCM';

/**
* Generate an Initialization Vector
* @returns {Buffer}
*/
function generateIv() {
return crypto.randomBytes(32);
}

const algorithm = 'AES-256-GCM';

/**
* Encrypt a secret
* @param {String} data Data to encrypt
Expand Down

0 comments on commit 8cc0c9f

Please sign in to comment.