From f47c3f4349cb68460dadf1fc381e3ceb52fe009a Mon Sep 17 00:00:00 2001 From: rohan09-raj Date: Fri, 19 Aug 2022 21:06:48 +0530 Subject: minor fixes --- server/utils/aadhaar.js | 4 ++-- server/utils/otp.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'server/utils') 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; }; -- cgit