Simplify random.hex
This commit is contained in:
parent
fb6a02185f
commit
9f9b83dc96
1 changed files with 1 additions and 1 deletions
|
@ -161,6 +161,6 @@ var random = { // eslint-disable-line no-unused-vars
|
||||||
return obj
|
return obj
|
||||||
},
|
},
|
||||||
hex: function (len) {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue