Simplify random.hex

This commit is contained in:
Jesse Schwartzentruber 2017-06-07 10:27:51 -04:00
parent fb6a02185f
commit 9f9b83dc96
1 changed files with 1 additions and 1 deletions

View File

@ -161,6 +161,6 @@ var random = { // eslint-disable-line no-unused-vars
return obj
},
hex: function (len) {
return Math.floor(Math.random() * ('0x1' + Array(len + 1).join('0'))).toString(16)
return this.number(Math.pow(2, len * 4)).toString(16)
}
}