diff options
Diffstat (limited to 'server/utils')
-rw-r--r-- | server/utils/aadhaar.js | 4 | ||||
-rw-r--r-- | server/utils/otp.js | 6 |
2 files changed, 6 insertions, 4 deletions
diff --git a/server/utils/aadhaar.js b/server/utils/aadhaar.js index cd81711..d5d03ae 100644 --- a/server/utils/aadhaar.js +++ b/server/utils/aadhaar.js @@ -1,4 +1,4 @@ -import {ELEVEN_TIMES_NINE} from '../constants/aadhaar'; +import {ONE_TEN_TIMES_ZERO, NINE_TEN_TIMES_ZERO} from '../constants/numbers'; // const generateCheckSumDigit = (randomNumberArray) => { // const d = [ @@ -93,7 +93,7 @@ function generate(array) { function generateAadhaar() { const aadhaarArray = []; - let x = Math.floor(Math.random() * ELEVEN_TIMES_NINE + 1); + let x = Math.floor(ONE_TEN_TIMES_ZERO + Math.random() * NINE_TEN_TIMES_ZERO); while (x != 0) { const digit = x % 10; diff --git a/server/utils/otp.js b/server/utils/otp.js index 9a2a0bc..091f6c1 100644 --- a/server/utils/otp.js +++ b/server/utils/otp.js @@ -1,7 +1,9 @@ -import {SIX_TIMES_NINE} from '../constants/aadhaar'; +import {ONE_FIVE_TIMES_ZERO, NINE_FIVE_TIMES_ZERO} from '../constants/numbers'; const generateOTP = () => { - const otp = Math.floor(Math.random() * SIX_TIMES_NINE + 1); + const otp = Math.floor( + ONE_FIVE_TIMES_ZERO + Math.random() * NINE_FIVE_TIMES_ZERO + ); return otp; }; |