Skip to content

Commit e063502

Browse files
authored
Forgot to add the HexRand
1 parent 377ddf4 commit e063502

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

basic256.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ HMAC_ALGORITHM = 'SHA256';
1010
KEY = savedKeys.key; // Use the automated script.
1111
HMAC_KEY = savedKeys.hmac_key; // Use the automated script.
1212

13+
function randomValueHex (len) {
14+
return crypto.randomBytes(Math.ceil(len/2))
15+
.toString('hex') // convert to hexadecimal format
16+
.slice(0,len); // return required number of characters
17+
};
18+
1319
var constant_time_compare = function (val1, val2) {
1420
var sentinel;
1521

0 commit comments

Comments
 (0)