diff --git a/ticc.js b/ticc.js index 8169381..27aad3a 100644 --- a/ticc.js +++ b/ticc.js @@ -968,7 +968,7 @@ class TicCrypto { */ static randomize_number ({ length, min, max } = {}) { // 长度为 length 的随机数字,或者 (min||0) <= num < max - var num = 0 + let num = 0 if (typeof length === 'number' && length > 0) { num = parseInt(Math.random() * Math.pow(10, length)) num = this.padStart(num.toString(), length, '0')