From 5fecd105532ccc74c769e3ca0a8e0eae06dd6b0e Mon Sep 17 00:00:00 2001 From: satya319 Date: Mon, 23 May 2022 23:17:34 +0530 Subject: [PATCH 1/6] changed package name --- .../io/github/studyandmasti/DataProvider.java | 130 ++++++++++++++ .../io/github/studyandmasti/PiratedData.java | 159 ++++++++++++++++++ Java/src/test/java/TestFunctions.java | 23 +-- 3 files changed, 302 insertions(+), 10 deletions(-) create mode 100644 Java/src/main/java/io/github/studyandmasti/DataProvider.java create mode 100644 Java/src/main/java/io/github/studyandmasti/PiratedData.java diff --git a/Java/src/main/java/io/github/studyandmasti/DataProvider.java b/Java/src/main/java/io/github/studyandmasti/DataProvider.java new file mode 100644 index 0000000..d63571c --- /dev/null +++ b/Java/src/main/java/io/github/studyandmasti/DataProvider.java @@ -0,0 +1,130 @@ +package io.github.studyandmasti; + +public class DataProvider { + String[] firstMaleName = { "Hari", "sam", "Mukund", "Nabaghan", "Abhishek", "Suresh", "Santunu", "Akashya", + "Haribol", "Madhab", "Balkrushna", "Aarav", "Vihaan", "Vivaan", "Ananya", "Diya", "Advik", "Kabir", "Anaya", + "Aarav", "Vivaan", "Aditya", "Vivaan", "Vihaan", "Arjun", "Vivaan", "Reyansh", "Mohammed", "Sai", "Arnav", + "Aayan", "Krishna", "Ishaan", "Shaurya", "Atharva", "Advik", "Pranav", "Advaith", "Aaryan", "Dhruv", + "Kabir", "Ritvik", "Aarush", "Kian", "Darsh", "Veer", "Aadil", "Aakash", "Aarif", "Aashu", "Aatif", + "Aayush", "Abdul", "Abdullah", "Abhash", "Abhimanyu", "Abhinav", "Abhishek", "Abrar", "Adi", "Aditya", + "Aftab", "Agyapad", "Ahsan", "Ajay", "Ajeet", "Ajit", "Ajman", "Akash", "Akbar", "Akhilesh", "Akhtar", + "Akram", "Akshay", "Akshpaat", "Altaf", "Aman", "Amar", "Amarjeet", "Ameen", "Amil", "Amit", "Anil", + "Anjali", "Ankit", "Ankur", "Ansh", "Anshu", "Anshul", "Ansu", "Anuj", "Anup", "Anurag", "Anwari", "Aoosaf", + "Arif", "Arman", "Arsad", "Arsh", "Arun", "Arvind", "Aryan", "Ashish", "Ashok", "Ashu", "Ashutosh", "Asif", + "Atul", "Avinash", "Ayan", "Azam", "Bablu", "Babu", "Babulal", "Baksi", "Balbir", "Balram", "Balwant", + "Banarsi", "Bandu", "Bangali", "Banwari", "Barkat", "Begraj", "Bhagwans", "Bhajanlal", "Bhanu", "Bharma", + "Bhupender", "Bhupesh", "Bijender", "Bijendra", "Bikki", "Birender", "Birij", "Birjesh", "Bishan", "Bittu", + "Bobi", "Boby", "Bram", "Brijmohan", "Chandan", "Chander", "Chanderpal", "Chandra", "Chandrram", "Chatan", + "Chatar", "Chaterpal", "Cheddi", "Chetan", "Chetanram", "Chirag", "Chitrangans", "Chran", "Daler", "Daniel", + "Danish", "Daya", "Deep", "Deepak", "Deepchand", "Deepender", "Deewan", "Desh", "Deshraj", "Deva", + "Devender", "Devinder", "Devraj", "Dhalchand", "Dhanna", "Dharam", "Dharmandra", "Dharmender", "Dharmvir", + "Dheeraj", "Dhramender", "Dhrmveer", "Dilip", "Dinesh", "Divansh", "Divyansh", "Dular", "Durganand", + "Faijal", "Farid", "Farmaan", "Firoj", "Fulmiya", "Ganesh", "Gaurav", "Gauri", "Gautam", "Ghan", + "Ghanshyam", "Giri", "Girish", "Gopi", "Gorav", "Gourav", "Gulfam", "Gulreg", "Gulshan", "Gyanendra", + "Haider", "Hansraj", "Harak", "Hararat", "Harendra", "Hari", "Harish", "Harison", "Harkesh", "Harpal", + "Harsh", "Harshal", "Harvinder", "Hazrat", "Hemant", "Himanshu", "Hosiyarilal", "Hrithik", "Imran", "Inder", + "Inderjeet", "Irshad", "Ishan", "Ishant", "Ishwar", "Islam", "Jabbar", "Jabir", "Jagmal", "Jahagir", + "Jahid", "Jaiprakash", "Jasbir", "Jasveer", "Jatin", "Javed", "Jeeshan", "Jeetu", "Jeeya", "Jitender", + "Jitendera", "Jitendra", "Kabul", "Kaif", "Kalu", "Kamruddin", "Kanhaiya", "Kapil", "Karan", "Kavilash", + "Keshave", "Khemraj", "Khursheed", "Kiran", "Kishan", "Kripal", "Krishan", "Krishana", "Kuldeep", "Kumar", + "Kumari", "Kunal", "Kundan", "Kushal", "Laksh", "Lal", "Lalan", "Lalaram", "Lalit", "Lamani", "Lave", + "Lawrence", "Laxman", "Lekhraj", "Leo", "Loknath", "Lokesh", "Madan", "Mahaveer", "Mahender", "Mahendra", + "Mahesh", "Mahipal", "Mamchand", "Mamta", "Man", "Manful", "Manish", "Manjeet", "Manjiv", "Mannu", "Manoj", + "Manpreet", "Mithlesh", "Mobin", "Mohan", "Mohit", "Moni", "Monu", "Mukeemuddin", "Mukesh", "Muneer", + "Munesh", "Nadeem", "Nandkishore", "Nandmeena", "Nandu", "Nanhe", "Narayan", "Narender", "Naresh", "Naseem", + "Nashim", "Neeraj", "Nikhil", "Nitin", "Noorhasan", "Omprakash", "Pancu", "Pankaj", "Paras", "Pardeep", + "Parmod", "Parteek", "Partik", "Pavan", "Pawan", "Phooleshwar", "Pintu", "Piyush", "Pooja", "Prabhjeet", + "Pradeep", "Prahlad", "Pramod", "Prasant", "Praveen", "Prem", "Prhalad", "Prince", "Punarjyoti", "Punit", + "Pushkar", "Puspak", "Rada", "Radha", "Radhey", "Raghubir", "Raghunandan", "Raghuvir", "Rahish", "Rahul", + "Raj", "Raja", "Rajan", "Rajaram", "Rajeev", "Rajendar", "Rajender", "Rajesh", "Rajiv", "Rajkumar", + "Rajneesh", "Rajni", "Raju", "Rajveer", "Rakesh", "Ram", "Ramchander", "Ramesh", "Ramhetu", "Ramkishan", + "Ramprasad", "Ramtek", "Randhir", "Ranjeet", "Ranjit", "Raseel", "Ratiman", "Ravi", "Ravikant", "Ravinder", + "Ravindra", "Raviraj", "Ridhakaran", "Rihan", "Rinki", "Rinku", "Rishi", "Riyaz", "Robin", "Rohit", "Ronak", + "Roshan", "Rupender", "Rupesh", "Sachin", "Saddam", "Sahil", "Sahrukh", "Sajjan", "Salim", "Salin", + "Salmaan", "Same", "Sameem", "Sameer", "Samsuddin", "Sandeep", "Sanjay", "Sanjeev", "Sanjiv", "Sanni", + "Sanny", "Santosh", "Sartaj", "Sarvan", "Satbar", "Satender", "Satish", "Satpal", "Satyam", "Satyvrat", + "Saurabh", "Sehzad", "Shabuddin", "Shagufta", "Shail", "Shailesh", "Shakil", "Shakti", "Shambhu", "Shamim", + "Shankar", "Sharukh", "Shashank", "Shashikant", "Shaukat", "Shayam", "Shayamveer", "Shibu", "Shisupal", + "Shiv", "Shiva", "Shivam", "Shivyalam", "Shobharam", "Shripal", "Shubham", "Shyam", "Shyamlal", "Shyamveer", + "Sidharath", "Sivam", "Somnath", "Sonu", "Subhakar", "Subhas", "Subhash", "Sudhansu", "Sudhir", "Suhail", + "Sujeet" }; + String[] title = { "Sahu", "Behera", "Nayak", "Das", "Pradhan", "Naik", "Majhi", "Jena", "Malik", "Swain", "Patra", + "Barik", "Mohanty", "Raut", "Bhoi", "Panda", "Sahoo", "Sethy", "Dei", "Biswal", "Singh", "Parida", "Munda", + "Mahanta", "Mahapatra", "Samal", "Mishra", "Maharana", "Rana", "Dash", "Bag", "Dehuri", "Padhan", "Meher", + "Gaud", "Pradhana", "Bibi", "Muduli", "Harijan", "Shabar", "Sethi", "Jani", "Nag", "Mandal", "Murmu", + "Patel", "Rout", "Mallick", "Gauda", "Bhue", "Kisan", "Nahak", "Giri", "Pattnayak", "Panigrahi", "Senapati", + "Padhi", "Khan", "Bhatara", "Bariha", "Dalei", "Bewa", "Lenka", "Bhatra", "Bhuyan", "Mahakud", "Dalai", + "Oram", "Ganda", "Suna", "Ray", "Tudu", "Gouda", "Pujari", "Tripathi", "Simha", "Ojha", "Kar", "Kumbhar", + "Nath", "Nanda", "Sa", "Rath", "Seth", "Mohanta", "Dhal", "Mahananda", "Mahalik", "Marndi", "Soren", + "Palei", "Baral", "Digal", "Hemrum", "Prushti", "Tandi", "Pati", "Bagha", "Dharua", "Khatua", "Bindhani", + "Raul", "Pal", "Bagartti", "Kahanra", "Putel", "Bisoyi", "Sabar", "Kandi", "Mohapatra", "Shatapathi", + "Dakua", "Samantaray", "Khuntia", "Mallik", "Santa", "Mirdha", "Khara", "Acharya", "Bisoi", "Begum", "Dip", + "Mali", "Pani", "Rao", "Sing", "Gochhayat", "Guru", "Agrawal", "Hansdah", "Bal", "Chowdhury", "Khatun", + "Hembram", "Pande", "Bisi", "Chhatria", "Sharma", "Debi", "Khadia", "Hati", "Dora", "Rautray", "Ghadei", + "Mahakur", "Kujur", "Ekka", "Lakra", "Podh", "Mukhi", "Khil", "Kumar", "Hantal", "Tarai", "Dehury", "Gahir", + "Rait", "Dey", "Saren", "Khamari", "Pattnaik", "Pangi", "Ho", "Jal", "Banachhor", "Gamanga", "Alli", "Hota", + "Sunani", "Hansa", "Pallai", "Sutar", "Sahani", "Naek", "Badatya", "Saha", "Khilar", "Dalabehera", + "Dandasena", "Paik", "Pujhari", "Pradhani", "Redi", "Pattanayak", "Purtti", "Gond", "Nial", "Bhol", + "Mahanti", "Subudhi", "Shadangi", "Biswas", "Madakami", "Kisku", "Paraja", "Gadanayak", "Kuanra", + "Tripathy", "Barla", "Chanda", "Ghosh", "Bhanja", "Barad", "Rohidas", "Thakur", "Mangaraj", "Gadaba", + "Chalan", "Datta", "Marandi", "Kalo", "Gupta", "Hansda", "Goud", "Mahakul", "Jhankar", "Ghadai", "Beura", + "Minz", "Juanga", "Bhumia", "Paikaray", "Sarakar", "Prusty", "Sasamal", "Lohar", "Minja", "Misra", "Puhan", + "Tanti", "Bagh", "Satanami", "Amanatya", "Thapa", "Lakada", "Behura", "Kadraka", "Budek", "Deo", "Kamar", + "Moharana", "Kishan", "Dhurua", "Lugun", "Samanta", "Sandh", "Mahanandia", "Kanhar", "Gopal", "Beshra", + "Badaik", "Luha", "Prasad", "Tirkey", "Tirki", "Mundari", "Bibhar", "Chandan", "Padiami", "Bhutia", "Sabat", + "Bastia", "Bhoe", "Jhodia", "Raita", "Jagat", "Malla", "Chhatar", "Mahankud", "Baske", "Kata", "Badhei", + "Danasana", "Mahali", "Satapathy", "Kaanra", "Madi", "Toppo", "Choudhury", "Kharsel", "Bej", "Raj", "Durga", + "Nandi", "Kanda", "Sisa", "Deheri", "Karmi", "Sen", "Maiti", "Hikaka", "Bishoyi", "Karan", "Purohit", + "Tappo", "Samad", "Tiria", "Mahar", "Shandh", "Dandapat", "Dalapati", "Pattanaik", "Rama", "Sagar", "Danga", + "Pingua", "Bhatta", "Kerketta", "Muni", "Kalar", "Mahanty", "Palai", "Debata", "Martha", "Devi", "Tarei", + "Begam", "Set", "Adhikari", "Agrawalla", "Mantri", "Karnna", "Hial", "Bhati", "Reddy", "Mandangi", "Bhukta", + "Dhir", "Chhura", "Bidika", "Dungdung", "Parija", "Kabasi", "Kabi", "Mahammad", "Sai", "Tete", "Chatar", + "Mahala", "Dungadunga", "Durua", "Kumura", "Kulu", "Badi", "Gagarai", "Baliyarasinh", "Hasada", "Mahana", + "Karua", "Penthei", "Jain", "Mahakhud", "Khatei", "Parichha", "Haladar", "Bemal", "Birua", "Kerketa", + "Sarangi", "Disari", "Samarath", "Punji", "Bachha", "Lima", "Bhumij", "Huika", "Roul", "Gadatia", "Amat", + "Takri", "Bishi", "Paridaa", "Keraketa", "Saura", "Patro", "Tandia", "Samantara", "Thela", "Sial", "Polei", + "Surin", "Si", "Padhiari", "Polai", "Pod", "Jayapuria", "Bai", "Pasayat", "Behuria", "Harapal", "Bhakta", + "Pramanik", "Tadingi", "Bera", "Kamila", "Dwibedi", "Khanda", "Karji", "Purty", "Achari", "Parmanik", + "Haripal", "Kandulana", "Kalet", "Chinda", "Harichandan", "Jagadala", "Bhainsa", "Prusti", "Bihari", + "Patnaik", "Tapno", "Golari", "Sundaray", "Manahira", "Yadab", "Praharaj", "Jali", "Chhotaray", "Kundu", + "Bhokta", "Jojo", "Kharasel", "Kumari", "Ghibhela", "Pandit", "Ranasingh", "Mistri", "Gochhaet", "Alam", + "Mahato", "Matari", "Jana", "Sinku", "Brahma", "Gardia", "Bage", "Bharati", "Taria", "Pahan", "Hansadah", + "Bano", "Mahunta", "Padhy", "Randhari", "Routray", "Amanta", "Deep", "Khandei", "Kandagari", "Kathar", + "Guntha", "Ketaki", "Lahajal", "Nisa", "Miniaka", "Parabhue", "Minyaka", "Kunda", "Khandual", "Kindo", + "Hembrum", "Palaka", "Kahanr", "Chandi", "Halaba", "Krisani", "Tapo", "Puta", "Buda", "Bada", "Sagaria", + "Chhatoi", "Gudia", "Baskey", "Negi", "Thanapati", "Sin", "Beg", "Lakshmi", "Saraph", "Gadatya", "Sika", + "Sarddar", "Luhura", "Patamajhi", "Panaka", "Madhei", "Bariki", "Mahalinga", "Soreng", "Babu", "Saunta", + "Raju", "Gochhi", "Bishoi", "Choudhuri", "Dhangadamajhi", "Basantia", "Rajahansa", "Dibya", "Sodi", + "Shrichandan", "Samantaraya", "Tanty", "Champia", "Bhaisal", "Bentakar", "Manna", "Kirsani", "Kudei", + "Badajena", "Kalata", "Banara", "Parua", "Himirika", "Khemundu", "Danta", "Gantayat", "Josi", "Karuan", + "Satapathi", "Sidar", "Kuanr", "Shankhua", "Dutta", "Kullu", "Eka", "Luhar", "Bud", "Khura", "Baghar", + "Meleka", "Khosala", "Muli", "Kuladip", "Gahan", "Apat", "Pandey", "Ram", "Adabar", "Pothal", "Bharasagar", + "Dikshit", "Sarenga", "Galari", "Sardar", "Gop", "Raika", "Ganta", "Kaibartta", "Kaudi", "Deuri", "Bagar", + "Banua", "Bhadra", "Kanta", "Keut", "Shadhangi", "Jadab", "Ksheti", "Bandichhor", "Balabantaray", "Tiwari", + "Mahat", "Sathua", "Pratihari", "Lohara", "Bardhan", "Xalxo", "Praska", "Bairagi", "Dila", "Husen", + "Saraka", "Kaur", "Dhibar", "Dixit", "Mandinga", "Mandingi", "Gamango", "Saradar", "Paharia", "Hernna", + "Tigga", "Bar", "Pagal", "Dhar", "Mandi", "Neti", "Sau", "Padhihari", "Bala", "Patri", "Khalakho", "Dhrua", + "Barua", "Pruseth", "Badarait", "Yadav", "Bhujabal", "Selama", "Mohakud", "Manika", "Yena", "Pidikaka", + "Sukla", "Bagarti", "Chakra", "Hosen", "Banka", "Kalasae", "Jued", "Uddin", "Budhia", "Khatoi", "Raya", + "Madkami", "Debanath", "Agarwal", "Topno", "Pandab", "Hans", "Shandha", "Barge", "Upadhyay", "Kabat", + "Baidya", "Parabhoe", "Sith", "Jha", "Benia", "Badara", "Sinha", "Sihna", "Pasaet", "Parabhoi", "Champati", + "Laguri", "Gemel", "Bhainsal", "Chhanda", "Makar", "Xess", "Adha", "Besra", "Chhuria", "Kalandi", "Parwin", + "Dandia", "Manasinh", "Kanungoo", "Burudi", "Bahadur", "Sarap", "Santara", "Bagal", "Madhi", "Garada", + "Ansari", "Nachika", "Khakha", "Garadia", "Mitra", "Sabitri", "Bari", "Chakrabarty", "Dangua", "Kandulna", + "Dwari", "Bir", "Dhada", "Duria", "Bahidar", "Parbati", "Rajak", "Chowhan", "Kheti", "Tunga", "Karakaria", + "Kido", "Khila", "Paital", "Pahi", "Ghibela", "Burma", "Khatoon", "Raheman", "Sundara", "Penthoi", "Mahal", + "Sandha", "Marei", "Rauta", "Pattayat", "Karjee", "Muna", "Juadi", "Pidika", "Majumdar", "Jamuda", + "Kulesika", "Pinga", "Jati", "Panigrahy", "Patika", "Sendh", "Rautaraya", "Mahabhoi", "Kampa", "Marnni", + "Dalua", "Parween", "Lahar", "Deogam", "Ranabida", "Karmakar", "Sagria", "Badra", "Besan", "Soni", "Ghasi", + "Ali", "Urma", "Singha", "Khosla", "Bhosagar", "Saraswati", "Karna", "Khes", "Mugri", "Ranajit", "Jethi", + "Agasti", "Shatapathy", "Soy", "Aehmad", "Bara", "Bishayi", "Bishai", "Goswami", "Mashra", "Mahankuda", + "Parimanik", "Karali", "Pandi", "Bhengra", "Beriha", "Rautaray", "Dal", "Kanungo", "Puala", "Bhagat", + "Perei", "Baliarasinh", "Pan", "Thatoi", "Urlaka", "Baa", "Karyi", "Dhali", "Baitharu", "Samantasinhar", + "Khanam", "Muthamajhi", "Bandichhod", "Nathasharma", "Mahamad", "Bahalia", "Hansada", "Jayasinh", "Jerai", + "Roy", "Shagadia", "Muria", "Gain", "Barman", "Kalia", "Pushti", "Badamundi", "Kusulia", "Lahara", "Sarkar", + "Biswakarma", "Baliarasin", "Kandh", "Sah", "Chaudhuri", "Kiro", "Misal", "Peda", "Sirika", "Jagadeb", + "Guin", "Sidu", "Behara", "Garia", "Sana", "Modi", "Bilunga", "Satpathy", "Suar", "Adajuad", "Sikaka", + "Suren", "Matia" }; + String[] emlDomain = {"gmail.com", "yahoo.com", "hotmail.com", "rediffmail.com", "mns.com", "github.com", "bandu.com", "baidu.com", "aol.com", "comcast.net"}; + +} diff --git a/Java/src/main/java/io/github/studyandmasti/PiratedData.java b/Java/src/main/java/io/github/studyandmasti/PiratedData.java new file mode 100644 index 0000000..0a9be66 --- /dev/null +++ b/Java/src/main/java/io/github/studyandmasti/PiratedData.java @@ -0,0 +1,159 @@ +package io.github.studyandmasti; + +import java.util.Date; +import java.util.Random; + +/** + * + * @author Satyajit319 + * date 03/03/2022 + */ + +public class PiratedData { + DataProvider dp = new DataProvider(); + String actfirName = ""; + String actlstName = ""; + String actFullName = ""; + String actGender = ""; + String actHairColor = ""; + String actEyeColor = ""; + String panNo = ""; + String passNo = ""; + String dlNum = ""; + String actBloodGroup = ""; + String actWeight = ""; + String actSkinColor = ""; + String actStateName = ""; + String actDistName = ""; + String actCardFullDetails = ""; + String firstDate1 = ""; + String actAge = ""; + Date secondDate = new Date(2012, 4, 12);// every year to be increase one year. + + /** + * This method can generate random First name of a person. + * @return firstName + */ + public String firstNameGenerator() { + int number = (int) Math.floor(Math.random() * 469); + actfirName = dp.firstMaleName[number]; + return actfirName; + + } + + /** + * This method can generate random Last name of a person. + * + * @return LastName + */ + public String lastNameGenerator() { + int number = (int) Math.floor(Math.random() * 806); + return actlstName = dp.title[number]; + } + + /** + * This method can generate full name of a person. + * + * @return FullName + */ + public String fullNameGenerator() { + if (actfirName == "") { + this.firstNameGenerator(); + } + if (actlstName == "") { + this.lastNameGenerator(); + } + String fullName = actfirName + " " + actlstName; + return actFullName = fullName; + } + + /** + * This method is for generate random mobile number + * + * @return MobileNumber + */ + public long mobileNumberGenerator() { + long mobNumber = (long) (Math.floor(Math.random() * (9999999999L - 6000000000L + 1)) + 6000000000L); + return mobNumber; + } + + /** + * This method generates aadharnumber of a person + * + * @return aadharnumber + */ + public long aadharNumberGenerator() { + long adharNum = (long) (Math.floor(Math.random() * (999999999999L - 100000000000L + 1)) + 100000000000L); + return adharNum; + } + + /** + * This method generte unique emailId every time. + * + * @return emailId + */ + public String emailIdGenerator() { + int emlNum = (int) (Math.floor(Math.random() * (999 - 100 + 1)) + 100); + int domain = (int) Math.floor(Math.random() * 10); + if (actfirName == "") { + this.firstNameGenerator(); + } + return actfirName + emlNum + '@' + dp.emlDomain[domain]; + } + /** + * This method gives the random user Id according to the first name of the person. + * @return userId + */ + public String userIdGenerator() { + if (actfirName == "") { + this.firstNameGenerator(); + } + int usrIdNum = (int) (Math.floor(Math.random() * (999 - 100 + 1)) + 100); + String userId = actfirName + usrIdNum; + return userId; + } + /** + * This method generate a strong alpha numeric password. + * @param length + * @return password + */ + public char[] passwordGenerator(int length) { + String capitalCaseLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + String lowerCaseLetters = "abcdefghijklmnopqrstuvwxyz"; + String specialCharacters = "!@#$"; + String numbers = "1234567890"; + String combinedChars = capitalCaseLetters + lowerCaseLetters + specialCharacters + numbers; + Random random = new Random(); + char[] password = new char[length]; + + password[0] = lowerCaseLetters.charAt(random.nextInt(lowerCaseLetters.length())); + password[1] = capitalCaseLetters.charAt(random.nextInt(capitalCaseLetters.length())); + password[2] = specialCharacters.charAt(random.nextInt(specialCharacters.length())); + password[3] = numbers.charAt(random.nextInt(numbers.length())); + + for(int i = 4; i< length ; i++) { + password[i] = combinedChars.charAt(random.nextInt(combinedChars.length())); + } + return password; + } + /** + * This function can generate long number. + * @return long number + */ + public long randomNumberGenerator() { + Random random = new Random(); + long longNumber = random.nextLong(); + return longNumber; + } + /** + * This function can generate integer type of number according to the range (0-maximum number provided) + * @param MaxNumber + * @return number + */ + public int randomNumberGenerator(int MaxNumber) { + Random random = new Random(); + int number = random.nextInt(MaxNumber); + return number; + } + +} diff --git a/Java/src/test/java/TestFunctions.java b/Java/src/test/java/TestFunctions.java index 279a913..625ede6 100644 --- a/Java/src/test/java/TestFunctions.java +++ b/Java/src/test/java/TestFunctions.java @@ -1,31 +1,34 @@ -import com.source.PiratedData; +import io.github.studyandmasti.PiratedData; public class TestFunctions extends PiratedData { public static void main(String[] args) { - PiratedData fun = new PiratedData(); - String firstName =fun.firstNameGenerator(); + PiratedData pd = new PiratedData(); + String firstName =pd.firstNameGenerator(); System.out.println(firstName); - String lastName = fun.lastNameGenerator(); + String lastName = pd.lastNameGenerator(); System.out.println(lastName); - String fullName = fun.fullNameGenerator(); + String fullName = pd.fullNameGenerator(); System.out.println(fullName); - long mobno = fun.mobileNumberGenerator(); + long mobno = pd.mobileNumberGenerator(); System.out.println(mobno); - long aadhar = fun.aadharNumberGenerator(); + long aadhar = pd.aadharNumberGenerator(); System.out.println(aadhar); - String email = fun.emailIdGenerator(); + String email = pd.emailIdGenerator(); System.out.println(email); - String userId = fun.userIdGenerator(); + String userId = pd.userIdGenerator(); System.out.println(userId); - char[] pass= fun.passwordGenerator(8); + char[] pass= pd.passwordGenerator(8); System.out.println(pass); + + int num = pd.randomNumberGenerator(45); + System.out.println(num); } } From 5ce534f48942b5ced2bf63017b97972844380499 Mon Sep 17 00:00:00 2001 From: satya319 Date: Sun, 21 Aug 2022 18:04:49 +0530 Subject: [PATCH 2/6] New function added for random number generation and JavaScript code standard optimization done. --- JavaScript/package/dataProvider.js | 28 +++--- JavaScript/package/index.js | 145 +++++++++++++++-------------- JavaScript/package/package.json | 12 ++- JavaScript/package/readme.md | 8 +- function_list_Lang.xlsx | Bin 0 -> 11362 bytes 5 files changed, 105 insertions(+), 88 deletions(-) create mode 100644 function_list_Lang.xlsx diff --git a/JavaScript/package/dataProvider.js b/JavaScript/package/dataProvider.js index c9929b6..df6c482 100644 --- a/JavaScript/package/dataProvider.js +++ b/JavaScript/package/dataProvider.js @@ -2,7 +2,7 @@ * @author Satyajit319 * date 27/03/2022 */ -var firstMaleName = ['Hari', 'sam', 'Mukund', 'Nabaghan', 'Abhishek', 'Suresh', 'Santunu', 'Akashya', 'Haribol', +let firstMaleName = ['Hari', 'sam', 'Mukund', 'Nabaghan', 'Abhishek', 'Suresh', 'Santunu', 'Akashya', 'Haribol', 'Madhab', 'Balkrushna', 'Aarav', 'Vihaan', 'Vivaan', 'Ananya', 'Diya', 'Advik', 'Kabir', 'Anaya', 'Aarav', 'Vivaan', 'Aditya', 'Vivaan', 'Vihaan', 'Arjun', 'Vivaan', 'Reyansh', 'Mohammed', 'Sai', 'Arnav', 'Aayan', 'Krishna', 'Ishaan', 'Shaurya', 'Atharva', 'Advik', 'Pranav', 'Advaith', 'Aaryan', @@ -51,7 +51,7 @@ var firstMaleName = ['Hari', 'sam', 'Mukund', 'Nabaghan', 'Abhishek', 'Suresh', 'Shripal', 'Shubham', 'Shyam', 'Shyamlal', 'Shyamveer', 'Sidharath', 'Sivam', 'Somnath', 'Sonu', 'Subhakar', 'Subhas', 'Subhash', 'Sudhansu', 'Sudhir', 'Suhail', 'Sujeet' ]; -var title = ["Sahu", "Behera", "Nayak", "Das", "Pradhan", "Naik", "Majhi", "Jena", "Malik", +let title = ["Sahu", "Behera", "Nayak", "Das", "Pradhan", "Naik", "Majhi", "Jena", "Malik", "Swain", "Patra", "Barik", "Mohanty", "Raut", "Bhoi", "Panda", "Sahoo", "Sethy", "Dei", "Biswal", "Singh", "Parida", "Munda", "Mahanta", "Mahapatra", "Samal", "Mishra", "Maharana", "Rana", "Dash", "Bag", "Dehuri", "Padhan", "Meher", "Gaud", "Pradhana", "Bibi", "Muduli", "Harijan", @@ -123,17 +123,17 @@ var title = ["Sahu", "Behera", "Nayak", "Das", "Pradhan", "Naik", "Majhi", "Jena "Badamundi", "Kusulia", "Lahara", "Sarkar", "Biswakarma", "Baliarasin", "Kandh", "Sah", "Chaudhuri", "Kiro", "Misal", "Peda", "Sirika", "Jagadeb", "Guin", "Sidu", "Behara", "Garia", "Sana", "Modi", "Bilunga", "Satpathy", "Suar", "Adajuad", "Sikaka", "Suren", "Matia", ]; -var emlDomain = ['gmail.com', 'yahoo.com', 'hotmail.com', 'rediffmail.com', 'mns.com', 'github.com', 'bandu.com', 'baidu.com', 'aol.com', 'comcast.net']; -var upiDomain = ['@BARODAMPAY', '@rbl', '@idbi', '@upi', '@aubank', '@axisbank', '@bandhan', '@dlb', '@indus', '@kbl', '@federal', '@sbi', '@uco', +let emlDomain = ['gmail.com', 'yahoo.com', 'hotmail.com', 'rediffmail.com', 'mns.com', 'github.com', 'bandu.com', 'baidu.com', 'aol.com', 'comcast.net']; +let upiDomain = ['@BARODAMPAY', '@rbl', '@idbi', '@upi', '@aubank', '@axisbank', '@bandhan', '@dlb', '@indus', '@kbl', '@federal', '@sbi', '@uco', '@yesbank', '@citi', '@citigold', '@dlb', '@dbs', '@freecharge', '@okhdfcbank', '@okaxis', '@oksbi', '@okicici', '@hsbc', '@idbi', '@icici', '@indianbank', '@allbank', '@kotak', '@ikwik', '@paytm', '@ybl', '@axl', '@ibl', '@sib'] -var gender = ['Male', 'Female', 'TransGender']; -var hairColor = ['Black', 'Brown', 'Red', 'Blond']; -var skinColor = ['Ivory', 'Beige', 'Alabaster', 'Honey', 'Carotenoid', 'Tan', 'Caramel', 'Bronze', 'Mahogany', 'Chestnut', 'Buff', 'Peaches', 'Umber', 'Praline', 'Espresso Brown', 'Porcelain', 'Hickory', 'Mustard', 'Sable', 'Almond', 'Bisque', 'Teak', 'Cacao', 'Pecan', 'Saddle Brown']; -var bloodGroup = ['A+', 'A-', 'B+', 'B-', 'O+', 'O-', 'AB+', 'AB-']; -var eyeColor = ['Brown', 'Blue', 'Hazel', 'Amber', 'Green', 'Gray', 'Red']; -var stateName = ['Andhra Pradesh', 'Arunachal Pradesh', 'Assam', 'Bihar', 'Chhattisgarh', 'Goa', 'Gujarat', 'Haryana', 'Himachal Pradesh', 'Jharkhand', 'Karnataka', 'Kerala', 'Madhya Pradesh', 'Maharashtra', 'Manipur', 'Meghalaya', 'Mizoram', 'Nagaland', 'Odisha', 'Punjab', 'Rajasthan', 'Sikkim', 'Tamil Nadu', 'Telangana', 'Tripura', 'Uttar Pradesh', 'Uttarakhand', 'West Bengal']; -var stateDist = { +let gender = ['Male', 'Female', 'TransGender']; +let hairColor = ['Black', 'Brown', 'Red', 'Blond']; +let skinColor = ['Ivory', 'Beige', 'Alabaster', 'Honey', 'Carotenoid', 'Tan', 'Caramel', 'Bronze', 'Mahogany', 'Chestnut', 'Buff', 'Peaches', 'Umber', 'Praline', 'Espresso Brown', 'Porcelain', 'Hickory', 'Mustard', 'Sable', 'Almond', 'Bisque', 'Teak', 'Cacao', 'Pecan', 'Saddle Brown']; +let bloodGroup = ['A+', 'A-', 'B+', 'B-', 'O+', 'O-', 'AB+', 'AB-']; +let eyeColor = ['Brown', 'Blue', 'Hazel', 'Amber', 'Green', 'Gray', 'Red']; +let stateName = ['Andhra Pradesh', 'Arunachal Pradesh', 'Assam', 'Bihar', 'Chhattisgarh', 'Goa', 'Gujarat', 'Haryana', 'Himachal Pradesh', 'Jharkhand', 'Karnataka', 'Kerala', 'Madhya Pradesh', 'Maharashtra', 'Manipur', 'Meghalaya', 'Mizoram', 'Nagaland', 'Odisha', 'Punjab', 'Rajasthan', 'Sikkim', 'Tamil Nadu', 'Telangana', 'Tripura', 'Uttar Pradesh', 'Uttarakhand', 'West Bengal']; +let stateDist = { 'Andhra Pradesh': ['Anantapuram', 'Chittoor', 'East Godavari', 'Guntur', 'YSR Kadapa', 'Krishna', 'Kurnool', 'Prakasam', 'Sri Potti Sriramulu Nellore', 'Srikakulam', 'Visakhapatnam', 'Vizianagaram', 'West Godavari'], 'Arunachal Pradesh': ['Anjaw', 'Changlang', 'Dibang Valley', 'East Kameng', 'East Siang', 'Kamle', 'Kra Daadi', 'Kurung Kumey', 'Lepa Rada', 'Lohit', 'Longding', 'Lower Dibang Valley', 'Lower Siang', 'Lower Subansiri', 'Namsai', 'Pakke Kessang', 'Papum Pare', 'Shi Yomi', 'Siang', 'Tawang', 'Tirap', 'Upper Siang', 'Upper Subansiri', 'West Kameng', 'West Siang'], 'Assam': ['Baksa', 'Barpeta', 'Biswanath', 'Bongaigaon', 'Cachar', 'Charaideo', 'Chirang', 'Darrang', 'Dhemaji', 'Dhubri', 'Dibrugarh', 'Dima Hasao', 'Goalpara', 'Golaghat', 'Hailakandi', 'Hojai', 'Jorhat', 'Kamrup', 'Kamrup Metropolitan', 'Karbi Anglong', 'Karimganj', 'Kokrajhar', 'Lakhimpur', 'Majuli', 'Morigaon', 'Nagaon', 'Nalbari', 'Sivasagar', 'South Salmara Mankachar', 'Sonitpur', 'Tinsukia', 'Udalguri', 'West Karbi Anglong'], @@ -163,21 +163,21 @@ var stateDist = { 'Uttarakhand': ['Almora', 'Bageshwar', 'Chamoli', 'Champawat', 'Dehradun', 'Haridwar', 'Nainital', 'Pauri Garhwal', 'Pithoragarh', 'Rudraprayag', 'Tehri Garhwal', 'Udham Singh Nagar', 'Uttarkashi'], 'West Bengal': ['Alipurduar', 'Bankura', 'Birbhum', 'Cooch Behar', 'Dakshin Dinajpur (South Dinajpur)', 'Darjeeling', 'Hooghly', 'Howrah', 'Jalpaiguri', 'Jhargram', 'Kalimpong', 'Kolkata', 'Malda', 'Murshidabad', 'Nadia', 'North 24 Parganas', 'Paschim Medinipur (West Medinipur)', 'Paschim (West) Burdwan (Bardhaman)', 'Purba Burdwan (Bardhaman)', 'Purba Medinipur (East Medinipur)', 'Purulia', 'South 24 Parganas', 'Uttar Dinajpur (North Dinajpur)'], }; -var stateList = { +let stateList = { "Andhra Pradesh": 13, "Arunachal Pradesh": 26, "Assam": 34, "Bihar": 38, "Chhattisgarh": 28, "Goa": 2, "Gujarat": 33, "Haryana": 22, "Himachal Pradesh": 12, "Jharkhand": 24, "Karnataka": 31, "Kerala": 14, "Madhya Pradesh": 52, "Maharashtra": 36, "Manipur": 16, "Meghalaya": 12, "Mizoram": 8, "Nagaland": 11, "Odisha": 30, "Punjab": 23, "Rajasthan": 33, "Sikkim": 4, "Tamil Nadu": 38, "Telangana": 33, "Tripura": 8, "Uttar Pradesh": 75, "Uttarakhand": 13, "West Bengal": 23 }; -var stateRtoCode = { +let stateRtoCode = { "Andhra Pradesh": "AP", "Arunachal Pradesh": "AR", "Assam": "AS", "Bihar": "BR", "Chhattisgarh": "CG", "Goa": "GA", "Gujarat": "GJ", "Haryana": "HR", "Himachal Pradesh": "HP", "Jharkhand": "JH", "Karnataka": "KA", "Kerala": "KL", "Madhya Pradesh": "MP", "Maharashtra": "MH", "Manipur": "MN", "Meghalaya": "ML", "Mizoram": "MZ", "Nagaland": "NL", "Odisha": "OD", "Punjab": "PN", "Rajasthan": "RJ", "Sikkim": "SK", "Tamil Nadu": "TN", "Telangana": "TS", "Tripura": "TR", "Uttar Pradesh": "UP", "Uttarakhand": "UK", "West Bengal": "WB" }; -var stateRtoCount = { +let stateRtoCount = { "Andhra Pradesh": 38, "Arunachal Pradesh": 16, "Assam": 34, "Bihar": 11, "Chhattisgarh": 30, "Goa": 6, "Gujarat": 38, "Haryana": 98, "Himachal Pradesh": 80, "Jharkhand": 24, "Karnataka": 71, "Kerala": 86, "Madhya Pradesh": 54, "Maharashtra": 50, "Manipur": 8, "Meghalaya": 14, "Mizoram": 9, "Nagaland": 8, "Odisha": 35, "Punjab": 99, "Rajasthan": 53, diff --git a/JavaScript/package/index.js b/JavaScript/package/index.js index f8ca23d..3f284bf 100644 --- a/JavaScript/package/index.js +++ b/JavaScript/package/index.js @@ -5,25 +5,25 @@ const { firstMaleName, title, emlDomain, upiDomain, gender, hairColor, skinColor, bloodGroup, eyeColor, stateName, stateDist, stateList,stateRtoCode,stateRtoCount } = require('./dataProvider.js'); -var actfirName = ""; -var actlstName = ""; -var actFullName = ""; -var actGender = ""; -var actHairColor = ""; -var actEyeColor = ""; -var panNo = ""; -var passNo = ""; -var actBloodGroup = ""; -var actWeight = ""; -var actSkinColor = ""; -var actStateName = ""; -var actDistName = ""; -var actCardFullDetails = ""; -var actUpiId=""; -var actMobileNumber=""; -var firstDate1 = ""; -var actAge = ""; -var secondDate = new Date(2012, 4, 12);// every year to be increase one year. +let actfirName = ""; +let actlstName = ""; +let actFullName = ""; +let actGender = ""; +let actHairColor = ""; +let actEyeColor = ""; +let panNo = ""; +let passNo = ""; +let actBloodGroup = ""; +let actWeight = ""; +let actSkinColor = ""; +let actStateName = ""; +let actDistName = ""; +let actCardFullDetails = ""; +let actUpiId=""; +let actMobileNumber=""; +let firstDate1 = ""; +let actAge = ""; +let secondDate = new Date(2012, 4, 12);// every year to be increase one year. /** @@ -31,7 +31,7 @@ var secondDate = new Date(2012, 4, 12);// every year to be increase one year. * @returns firstName */ function firstNameGenerator() { - var number = Math.floor(Math.random() * 469); + let number = Math.floor(Math.random() * 469); //var lengthofarray = firstMaleName.length; return actfirName = firstMaleName[number]; } @@ -41,7 +41,7 @@ exports.firstNameGenerator = firstNameGenerator; * @returns LastName */ function lastNameGenerator() { - var number = Math.floor(Math.random() * 806); + let number = Math.floor(Math.random() * 806); return actlstName = title[number]; } exports.lastNameGenerator = lastNameGenerator; @@ -56,7 +56,7 @@ function fullNameGenerator() { if (actlstName == "") { this.lastNameGenerator(); } - var fullName = actfirName + " " + actlstName; + let fullName = actfirName + " " + actlstName; return actFullName = fullName; } exports.fullNameGenerator = fullNameGenerator; @@ -66,7 +66,7 @@ exports.fullNameGenerator = fullNameGenerator; * @deprecated */ function adultAgeGenerator() { - var age = Math.floor(Math.random() * (99 - 18 + 1)) + 18; + let age = Math.floor(Math.random() * (99 - 18 + 1)) + 18; return ageYrs = age; } exports.adultAgeGenerator = adultAgeGenerator; @@ -84,7 +84,7 @@ exports.mobileNumberGenerator = mobileNumberGenerator; * @returns aadharnumber */ function aadharNumberGenerator() { - var adharNum = Math.floor(Math.random() * (999999999999 - 100000000000 + 1)) + 100000000000; + let adharNum = Math.floor(Math.random() * (999999999999 - 100000000000 + 1)) + 100000000000; return adharNum; } exports.aadharNumberGenerator = aadharNumberGenerator; @@ -93,8 +93,8 @@ exports.aadharNumberGenerator = aadharNumberGenerator; * @returns emailId */ function emailIdGenerator() { - var emlNum = Math.floor(Math.random() * (999 - 100 + 1)) + 100; - var domain = Math.floor(Math.random() * 10); + let emlNum = Math.floor(Math.random() * (999 - 100 + 1)) + 100; + let domain = Math.floor(Math.random() * 10); if (actfirName == "") { this.firstNameGenerator(); } @@ -109,7 +109,7 @@ function upiIdGenerator(){ if(actMobileNumber==""){ this.mobileNumberGenerator(); } -var upiIdIndex = Math.floor(Math.random() * 35); +let upiIdIndex = Math.floor(Math.random() * 35); actUpiId = actMobileNumber + upiDomain[upiIdIndex]; return actUpiId; } @@ -122,7 +122,7 @@ function userIdGenerator() { if (actfirName == "") { this.firstNameGenerator(); } - var usrIdNum = Math.floor(Math.random() * (999 - 100 + 1)) + 100; + let usrIdNum = Math.floor(Math.random() * (999 - 100 + 1)) + 100; return userId = actfirName + usrIdNum; } exports.userIdGenerator = userIdGenerator; @@ -133,10 +133,10 @@ exports.userIdGenerator = userIdGenerator; * @returns password */ function passwordGenerator(len) { - var str = ""; - for (var i = 0; i < len; i++) { - var rand = Math.floor(Math.random() * 62); - var charCode = rand += rand > 9 ? (rand < 36 ? 55 : 61) : 48; + let str = ""; + for (let i = 0; i < len; i++) { + let rand = Math.floor(Math.random() * 62); + let charCode = rand += rand > 9 ? (rand < 36 ? 55 : 61) : 48; str += String.fromCharCode(charCode); } return str; @@ -147,17 +147,17 @@ exports.passwordGenerator = passwordGenerator; * @returns panNo */ function panCardId() { - var result = ''; - var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; - var charactersLength = characters.length; - for (var i = 0; i < 3; i++) { + let result = ''; + let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; + let charactersLength = characters.length; + for (let i = 0; i < 3; i++) { result += characters.charAt(Math.floor(Math.random() * charactersLength)); } if (actlstName == "") { this.lastNameGenerator(); } - var lastNamefirstChar = actlstName.substring(0, 1); - var num = Math.floor(Math.random() * (9999 - 1000 + 1)) + 1000; + let lastNamefirstChar = actlstName.substring(0, 1); + let num = Math.floor(Math.random() * (9999 - 1000 + 1)) + 1000; const lastChar = characters.charAt(Math.floor(Math.random() * 26)) panNo = result + "P" + lastNamefirstChar + num + lastChar; return panNo; @@ -171,7 +171,7 @@ function passportNumber() { const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; const charactersLength = characters.length; result = characters.charAt(Math.floor(Math.random() * charactersLength)); - var num = Math.floor(Math.random() * (999999999 - 100000000 + 1)) + 100000000; + let num = Math.floor(Math.random() * (999999999 - 100000000 + 1)) + 100000000; passNo = result + num; return passNo; } @@ -188,7 +188,7 @@ function drivinglicenseGenerator(){ var rtoCode = stateRtoCode[actStateName]; } if(actStateName){ - var rtoNum = Math.floor(Math.random() * stateRtoCount[actStateName]); + let rtoNum = Math.floor(Math.random() * stateRtoCount[actStateName]); // actDistName = stateDist[actStateName]; if(rtoNum >=1 && rtoNum<10){ rtoNum ="0" + rtoNum ; @@ -209,7 +209,7 @@ exports.drivinglicenseGenerator = drivinglicenseGenerator; * @returns gender */ function genderGenerator() { - var gen = Math.floor(Math.random() * 3); + let gen = Math.floor(Math.random() * 3); return actGender = gender[gen]; } exports.genderGenerator = genderGenerator; @@ -230,7 +230,7 @@ function birthDateTimeGenerator() { const dy = firstDate2[2]; firstDate1 = yr + "-" + mn + "-" + dy; return firstDate1; - // return new Date(); + } exports.birthDateTimeGenerator = birthDateTimeGenerator; /** @@ -241,7 +241,7 @@ function ageCalculation() { if (firstDate1 == "") { this.birthDateTimeGenerator(); } - var firstDate = new Date(firstDate1); + let firstDate = new Date(firstDate1); secondDate = new Date(); if (firstDate > secondDate) [firstDate, secondDate] = [secondDate, firstDate]; @@ -314,7 +314,7 @@ function getYearsDiff(startDate = new Date(), endDate = new Date()) { * @returns haircolor */ function hairColorGenerator() { - var hairclr = Math.floor(Math.random() * 4); + let hairclr = Math.floor(Math.random() * 4); return actHairColor = hairColor[hairclr]; } exports.hairColorGenerator = hairColorGenerator; @@ -323,7 +323,7 @@ exports.hairColorGenerator = hairColorGenerator; * @returns eyecolor */ function eyeColorGenerator() { - var eyeclr = Math.floor(Math.random() * 7); + let eyeclr = Math.floor(Math.random() * 7); return actEyeColor = eyeColor[eyeclr]; } exports.eyeColorGenerator = eyeColorGenerator; @@ -332,7 +332,7 @@ exports.eyeColorGenerator = eyeColorGenerator; * @returns bloodgroup */ function bloodGroupGenerator() { - var bldgrp = Math.floor(Math.random() * 8); + let bldgrp = Math.floor(Math.random() * 8); return actBloodGroup = bloodGroup[bldgrp]; } exports.bloodGroupGenerator = bloodGroupGenerator; @@ -341,7 +341,7 @@ exports.bloodGroupGenerator = bloodGroupGenerator; * @returns weight */ function weightGenerator() { - var wt = Math.floor(Math.random() * (109 - 35 + 1)) + 35; + let wt = Math.floor(Math.random() * (109 - 35 + 1)) + 35; return actWeight = wt; } exports.weightGenerator = weightGenerator; @@ -350,7 +350,7 @@ exports.weightGenerator = weightGenerator; * @returns skincolor */ function skinColorGenerator() { - var sknclr = Math.floor(Math.random() * 25); + let sknclr = Math.floor(Math.random() * 25); return actSkinColor = skinColor[sknclr]; } exports.skinColorGenerator = skinColorGenerator; @@ -403,7 +403,7 @@ exports.BiologicalData = BiologicalData; * @returns stateName */ function stateGenerator() { - var number = Math.floor(Math.random() * 28); + let number = Math.floor(Math.random() * 28); return actStateName = stateName[number]; } exports.stateGenerator = stateGenerator; @@ -417,7 +417,7 @@ function distGenerator() { this.stateGenerator(); } if(actStateName){ - var dis = Math.floor(Math.random() * stateList[actStateName]); + let dis = Math.floor(Math.random() * stateList[actStateName]); actDistName = stateDist[actStateName][dis] } return actDistName; @@ -453,11 +453,11 @@ function financialCardGenerator() { if (actFullName == "") { this.fullNameGenerator(); } - var validMnth = Math.floor(Math.random() * 12); - var validYr = Math.floor(Math.random() * (2027 - 2022 + 1)) + 2022; - var cvv = Math.floor(Math.random() * (999 - 100 + 1)) + 100; - var visaElectronNum = Math.floor(Math.random() * (4999999999999999 - 4101110010111111 + 1)) + 4101110010111111; - var validThru = validMnth + "/" + validYr; + let validMnth = Math.floor(Math.random() * 12); + let validYr = Math.floor(Math.random() * (2027 - 2022 + 1)) + 2022; + let cvv = Math.floor(Math.random() * (999 - 100 + 1)) + 100; + let visaElectronNum = Math.floor(Math.random() * (4999999999999999 - 4101110010111111 + 1)) + 4101110010111111; + let validThru = validMnth + "/" + validYr; actCardFullDetails = [actFullName, visaElectronNum, validThru, cvv]; return actCardFullDetails; } @@ -470,11 +470,11 @@ exports.financialCardGenerator = financialCardGenerator; * @returns bunchAddress */ function hugeAddressGenerator(desiredDataSetNumber) { - var bunchAddress = []; + let bunchAddress = []; for (let i = 0; i < desiredDataSetNumber; i++) { actFullName = firstMaleName[Math.floor(Math.random() * 469)] + ' ' + title[Math.floor(Math.random() * 10)]; - var state = this.stateGenerator(); - var dist = this.distGenerator(); + let state = this.stateGenerator(); + let dist = this.distGenerator(); bunchAddress.push([actFullName, state, dist]); } return bunchAddress; @@ -487,20 +487,29 @@ exports.hugeAddressGenerator = hugeAddressGenerator; * @returns bunchBio */ function hugeBiologicalDataGenerator(desiredDataSetNumber) { - var bunchBio = []; + let bunchBio = []; for (let i = 0; i < desiredDataSetNumber; i++) { - var fulName = firstMaleName[Math.floor(Math.random() * 469)] + ' ' + title[Math.floor(Math.random() * 10)]; - var gen = gender[Math.floor(Math.random() * 3)]; - var hairclr = hairColor[Math.floor(Math.random() * 4)]; + let fulName = firstMaleName[Math.floor(Math.random() * 469)] + ' ' + title[Math.floor(Math.random() * 10)]; + let gen = gender[Math.floor(Math.random() * 3)]; + let hairclr = hairColor[Math.floor(Math.random() * 4)]; //var age = Math.floor(Math.random() * (99 - 18 + 1)) + 18; - var dob = this.birthDateTimeGenerator(); - var age = this.ageCalculation(); - var eyeclr = eyeColor[Math.floor(Math.random() * 7)]; - var bldGrp = bloodGroup[Math.floor(Math.random() * 8)]; - var weight = Math.floor(Math.random() * (109 - 35 + 1)) + 35; - var sknClr = skinColor[Math.floor(Math.random() * 25)]; + let dob = this.birthDateTimeGenerator(); + let age = this.ageCalculation(); + let eyeclr = eyeColor[Math.floor(Math.random() * 7)]; + let bldGrp = bloodGroup[Math.floor(Math.random() * 8)]; + let weight = Math.floor(Math.random() * (109 - 35 + 1)) + 35; + let sknClr = skinColor[Math.floor(Math.random() * 25)]; bunchBio.push([fulName, gen, hairclr, dob, age, eyeclr, bldGrp, weight, sknClr]); } return bunchBio; } exports.hugeBiologicalDataGenerator = hugeBiologicalDataGenerator; +/** + * This function generate random number 0 to 999999999999 + * @returns randomNumber + */ + function randomNumberGenerator(maxNumber){ + var number = Math.floor(Math.random() * maxNumber); + return number; +} +exports.randomNumberGenerator = randomNumberGenerator; diff --git a/JavaScript/package/package.json b/JavaScript/package/package.json index 6f7cc57..9782e66 100644 --- a/JavaScript/package/package.json +++ b/JavaScript/package/package.json @@ -1,6 +1,6 @@ { "name": "pirated-data", - "version": "2.0.01", + "version": "2.0.02", "description": "Generating sample user data like name, age, mobilenumber, aadharnumber etc for testing.", "main": "index.js", "scripts": { @@ -8,7 +8,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/satya319/pirated-data.git" + "url": "git+https://github.com/studyandmasti/pirated-data.git" }, "keywords": [ "sampledata", @@ -16,12 +16,14 @@ "user data", "test data", "Selenium mock data", - "cypress mock data" + "cypress mock data", + "JavaScript", + "Java" ], "author": "Satyajit319", "license": "ISC", "bugs": { - "url": "https://github.com/satya319/pirated-data/issues" + "url": "https://github.com/studyandmasti/pirated-data/issues" }, - "homepage": "https://github.com/satya319/pirated-data#readme" + "homepage": "https://github.com/studyandmasti/pirated-data#readme" } diff --git a/JavaScript/package/readme.md b/JavaScript/package/readme.md index 4a78c5f..22108dd 100644 --- a/JavaScript/package/readme.md +++ b/JavaScript/package/readme.md @@ -1,7 +1,7 @@

- Pirated-Data + Pirated-Data

@@ -22,11 +22,13 @@ npm i pirated-data - [Mobile number](#Mobile-number) - [Aadhar number ( unique identification number)](#Aadhar-number-(unique-identification-number)) - [Email-id](#Email-id) +- [Upi-Id](#Upi-Id) - [User Id](#User-Id) - [Password](#Password) - [PanCard ID](#PanCard-ID) - [Passport Number](#Passport-Number) - [Driving license number](#Driving-license-number) +- [Random number](#Random-Number) - [Financial card](#Financial-card) - [Card Number](#Card-Number) - [Card Holder Name](#Card-Holder-Name) @@ -123,6 +125,10 @@ const userData = require('pirated-data'); /* For generating a district of an user */ const userData = require('pirated-data'); var dist = userData.distGenerator(); + +/* For generating random number upto a certain range */ +const userData = require('pirated-data'); +var randomNumber = userData.randomNumberGenerator(MaxLimit); ``` diff --git a/function_list_Lang.xlsx b/function_list_Lang.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..679baaf0030ad5dadc1b9e6f26e765c4767053e7 GIT binary patch literal 11362 zcmeHtgB`w`0(jhHf($d`^Gjw-%NjFM&gMf60bO_Q&cL{u>?>Wc!<@o&t zzq7BYHG7`>n!Wb@)V-FX3=}jr02Tlb0077U?s5HOZV&)~FAM;H1%QWqD{5y8GO-2e zskqvk0CkvMY^LPOGK10cb_|KIU{cm_%nhHO8xqKjW8-lD}e;IM&|RB?R8Nr!L| zZXu{MDRDz>TwxKtS3+Gs7Q4{;$>q*vx*y7#@)K30@oEYSty@#WTIf;g13yGEv7ZRs z?FfWJOKFx_nvr1<3bBzaub`L_qP@4T?U7Xxdk~i%W-!Mt9QEJK_#7yK;T@#xmdK)l za9XwE9oJL?o#ZxU88UH>8d=c;#hIy11O5!-4zR`*es_Q)!p!7$Ikd&7*61T zaEr%$B`8eLXHo+~@y!RpXVgJ-=40L6c}ESByk6G*Vj zu7Eu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fp zIc83JR4{!b!B6n+w7*4CM8*%eJsUqVlgk?XFO z>jTZ#ErLrChc4n=%U>CMPXoPPCrhSScm74MuIZ(g9?6GH_nrMo1CN?fY(n`|A8}{| z0$B6q9;*bgTH$o(1UO@?V8-F&vaD}*hr~!x8ziq*KYWQ^P$#2swunhiWBg#|bf3DmAHU$8-zy;|4e--~J z&eO%*-$?k#|M?UDwY2*b<*9c68^s>;k4pYifTzOAZ-AHhzW{#AC{InFHj%$gjfnm- zecDn!MR?kt{6>%=c{&GwY*wBEKCSkD1Im&90(?^I|FQOe3i{95@i!y@ph5-!{8uIU z)cl|M{_o~1;Fjz^=Ksq6Pp$tMZvSqbN&Po#qyGe7MHv_{iGQkKC;&6CA8gY89Q{8c C9!R4A literal 0 HcmV?d00001 From f049016146ed1b0df7c66bed9cd30601540f2113 Mon Sep 17 00:00:00 2001 From: satya319 Date: Sun, 21 Aug 2022 18:28:49 +0530 Subject: [PATCH 3/6] readme updated --- README.md | 140 +++++++++++++++--------------------------------------- 1 file changed, 37 insertions(+), 103 deletions(-) diff --git a/README.md b/README.md index 3b286fc..b5d4e4a 100644 --- a/README.md +++ b/README.md @@ -47,85 +47,6 @@ npm i pirated-data - [Full Name](#Full-Name) - [State Name](#State-Name) - [District Name](#District-Name) - -### To use the package's individual function ------------------------------------------------ -``` -// For getting first name -const userData = require('pirated-data'); -var startname = userData.firstNameGenerator(); - - -/* For getting last name */ -const userData = require('pirated-data'); -var lastName =userData.lastNameGenerator(); - -/* For full name of an user */ -const userData = require('pirated-data'); -var fulName = userData.fullNameGenerator(); - - -// For getting Age -const userData = require('pirated-data'); -var age = userData.adultAgeGenerator(); - -// For getting mobile number -const userData = require('pirated-data'); -var mobnum = userData.mobileNumberGenerator(); - -// For getting financial card number -const userData = require('pirated-data'); -var card = userData.financialCardGenerator(); - -/* For getting Bank Name */ -const userData = require('pirated-data'); - var bnkName = userData.bankNameGenerator(); - -// For getting AadharCard number -const userData = require('pirated-data'); -var aadhar = userData.aadharNumberGenerator(); - -//For getting email-id -const userData = require('pirated-data'); -var eml = userData.emailIdGenerator(); - -// For getting userId -const userData = require('pirated-data'); -var usrId = userData.userId(); - -// For getting Password -/* pass the value of desired length of password inside the parenthesis. -It will give you the alphanumeric -*/ -const userData = require('pirated-data'); -var pwd = userData.password(10); - -/*For getting pancard number */ -var id = userData.panCardId(); -console.log(id); - -/*For getting passport number */ - const passNum = userData.passportNumber(); - console.log(passNum); - -/*For getting DL number */ -const dl = userData.drivinglicenseGenerator(); -console.log(dl); - -/* For generating Gendor of an user */ -const userData = require('pirated-data'); - var gender = userData.genderGenerator(); - -/* For generating the state of an user */ -const userData = require('pirated-data'); - var state = userData.stateGenerator(); - -/* For generating a district of an user */ -const userData = require('pirated-data'); - var dist = userData.distGenerator(); - - -``` ### Pirated-Data also supports generate sets of data - [Address](#Address) - [Full Name](#Full-Name) @@ -142,31 +63,44 @@ const userData = require('pirated-data'); - [Weight](#Weight) - [Body Skin Color](#Body-Skin-Color) +### Function List according to the Language + +This plugin/dependency/library is continuously increasing functionality for different languages. You can refer this table for use the function. + +| Function Name | Java | JavaScript | +|---|---|---| +| firstNameGenerator() | Yes | Yes | +| lastNameGenerator() | Yes | Yes | +| fullNameGenerator() | Yes | Yes | +| mobileNumberGenerator() | Yes | Yes | +| aadharNumberGenerator() | Yes | Yes | +| emailIdGenerator() | Yes | Yes | +| userIdGenerator() | Yes | Yes | +| passwordGenerator(int length) | Yes | Yes | +| randomNumberGenerator() | Yes | No | +| randomNumberGenerator(int MaxNumber) | Yes | Yes | +| panCardId() | Yes | Yes | +| upiIdGenerator() | Yes | Yes | +| hairColorGenerator() | Yes | Yes | +| genderGenerator() | Yes | Yes | +| birthDateTimeGenerator() | Yes | Yes | +| eyeColorGenerator() | Yes | Yes | +| bloodGroupGenerator() | Yes | Yes | +| skinColorGenerator() | Yes | Yes | +| weightGenerator() | Yes | Yes | +| ageCalculation() | Yes | Yes | +| passportNumber() | Yes | Yes | +| drivinglicenseGenerator() | No | Yes | +| BiologicalData() | No | Yes | +| stateGenerator() | No | Yes | +| distGenerator() | No | Yes | +| addressGenerator() | No | Yes | +| financialCardGenerator() | No | Yes | +| hugeAddressGenerator(desiredDataSetNumber) | No | Yes | +| hugeBiologicalDataGenerator(desiredDataSetNumber) | No | Yes | + +### To know how to use upper functions, you can refer corresponding language document available in this repo or you can visit our website [study and masti](https://studyandmasti.github.io/en/studyandmasti/home/) . - -To generate biological details and address use the below functions -``` -/* To generate biological details of an user */ -const userData = require('pirated-data'); - var biology = userData.BiologicalData(); - -/* To generate Address of an user */ -const userData = require('pirated-data'); -var address = userData.addressGenerator(); - -/* To generate huge set of biological data */ -const userData = require('pirated-data'); -const desirednumber = 10; -var bnchBio = userData.hugeBiologicalDataGenerator(desirednumber); -console.log(bnchBio); -It will generate the 10 sets of user data. - -/* To generate huge set of Address data */ -const userData = require('pirated-data'); -const desirednumber = 10; -var bnchAddress = userData.hugeAddressGenerator(desirednumber); -console.log(bnchAddress); -``` ## Need More feature _________________________________ If you want to more feature of this package just create an issue [Here.](https://github.com/satya319/pirated-data/issues) From 6d3865ee86f8fb533e8a54e6c2060875c00e9b6c Mon Sep 17 00:00:00 2001 From: satya319 Date: Sun, 21 Aug 2022 18:31:01 +0530 Subject: [PATCH 4/6] readme modified --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b5d4e4a..5487da1 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ npm i pirated-data - [Weight](#Weight) - [Body Skin Color](#Body-Skin-Color) -### Function List according to the Language +### Function Lists available according to the Language This plugin/dependency/library is continuously increasing functionality for different languages. You can refer this table for use the function. From 69f82081457473dbea21bd0b3b0016a720e01696 Mon Sep 17 00:00:00 2001 From: satya319 Date: Sun, 21 Aug 2022 22:13:05 +0530 Subject: [PATCH 5/6] Javascript bug fix --- JavaScript/package/index.js | 16 +--- JavaScript/package/package.json | 2 +- JavaScript/package/readme.md | 149 ++++++++++---------------------- 3 files changed, 53 insertions(+), 114 deletions(-) diff --git a/JavaScript/package/index.js b/JavaScript/package/index.js index 3f284bf..6afef1a 100644 --- a/JavaScript/package/index.js +++ b/JavaScript/package/index.js @@ -12,7 +12,7 @@ let actGender = ""; let actHairColor = ""; let actEyeColor = ""; let panNo = ""; -let passNo = ""; +var passNo = ""; let actBloodGroup = ""; let actWeight = ""; let actSkinColor = ""; @@ -60,16 +60,6 @@ function fullNameGenerator() { return actFullName = fullName; } exports.fullNameGenerator = fullNameGenerator; -/** - * This method is for generate random age between (18-99). - * @returns age - * @deprecated - */ -function adultAgeGenerator() { - let age = Math.floor(Math.random() * (99 - 18 + 1)) + 18; - return ageYrs = age; -} -exports.adultAgeGenerator = adultAgeGenerator; /** * This method is for generate random mobile number * @returns MobileNumber @@ -123,6 +113,7 @@ function userIdGenerator() { this.firstNameGenerator(); } let usrIdNum = Math.floor(Math.random() * (999 - 100 + 1)) + 100; + let userId; return userId = actfirName + usrIdNum; } exports.userIdGenerator = userIdGenerator; @@ -170,7 +161,7 @@ exports.panCardId = panCardId; function passportNumber() { const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; const charactersLength = characters.length; - result = characters.charAt(Math.floor(Math.random() * charactersLength)); + let result = characters.charAt(Math.floor(Math.random() * charactersLength)); let num = Math.floor(Math.random() * (999999999 - 100000000 + 1)) + 100000000; passNo = result + num; return passNo; @@ -200,6 +191,7 @@ var rtoCode = stateRtoCode[actStateName]; const yr = Math.floor(Math.random() * (2022 - 1998 + 1)) + 1998; const appNo = Math.floor(Math.random() * (8888888 - 1000000 + 1)) + 1000000; const dl = rtoCode + rtoNum + yr + appNo; + let dlNum; return dlNum = dl; } exports.drivinglicenseGenerator = drivinglicenseGenerator; diff --git a/JavaScript/package/package.json b/JavaScript/package/package.json index 9782e66..bf3fc7a 100644 --- a/JavaScript/package/package.json +++ b/JavaScript/package/package.json @@ -1,6 +1,6 @@ { "name": "pirated-data", - "version": "2.0.02", + "version": "2.0.03", "description": "Generating sample user data like name, age, mobilenumber, aadharnumber etc for testing.", "main": "index.js", "scripts": { diff --git a/JavaScript/package/readme.md b/JavaScript/package/readme.md index 22108dd..b10ffe2 100644 --- a/JavaScript/package/readme.md +++ b/JavaScript/package/readme.md @@ -50,88 +50,8 @@ npm i pirated-data - [State Name](#State-Name) - [District Name](#District-Name) -### To use the package's individual function ------------------------------------------------ -``` -// For getting first name -const userData = require('pirated-data'); -var startname = userData.firstNameGenerator(); - - -/* For getting last name */ -const userData = require('pirated-data'); -var lastName =userData.lastNameGenerator(); - -/* For full name of an user */ -const userData = require('pirated-data'); -var fulName = userData.fullNameGenerator(); - - -// For getting Age -const userData = require('pirated-data'); -var age = userData.adultAgeGenerator(); - -// For getting mobile number -const userData = require('pirated-data'); -var mobnum = userData.mobileNumberGenerator(); - -// For getting financial card number -const userData = require('pirated-data'); -var card = userData.financialCardGenerator(); - -/* For getting Bank Name */ -const userData = require('pirated-data'); - var bnkName = userData.bankNameGenerator(); - -// For getting AadharCard number -const userData = require('pirated-data'); -var aadhar = userData.aadharNumberGenerator(); - -//For getting email-id -const userData = require('pirated-data'); -var eml = userData.emailIdGenerator(); - -// For getting userId -const userData = require('pirated-data'); -var usrId = userData.userId(); - -// For getting Password -/* pass the value of desired length of password inside the parenthesis. -It will give you the alphanumeric -*/ -const userData = require('pirated-data'); -var pwd = userData.password(10); - -/*For getting pancard number */ -var id = userData.panCardId(); -console.log(id); -/*For getting passport number */ - const passNum = userData.passportNumber(); - console.log(passNum); -/*For getting DL number */ -const dl = userData.drivinglicenseGenerator(); -console.log(dl); - -/* For generating Gendor of an user */ -const userData = require('pirated-data'); - var gender = userData.genderGenerator(); - -/* For generating the state of an user */ -const userData = require('pirated-data'); - var state = userData.stateGenerator(); - -/* For generating a district of an user */ -const userData = require('pirated-data'); - var dist = userData.distGenerator(); - -/* For generating random number upto a certain range */ -const userData = require('pirated-data'); -var randomNumber = userData.randomNumberGenerator(MaxLimit); - - -``` ### Pirated-Data also supports generate sets of data - [Address](#Address) - [Full Name](#Full-Name) @@ -148,31 +68,58 @@ var randomNumber = userData.randomNumberGenerator(MaxLimit); - [Weight](#Weight) - [Body Skin Color](#Body-Skin-Color) - - -To generate biological details and address use the below functions +### Import to your TypeScript project +``` +import userData from 'pirated-data'; +``` +Example :
+``` +import userData from 'pirated-data'; +let fulName = userData.userIdGenerator(); + console.log("pirated data test: ",fulName); +``` +### Import to your JavaScript project ``` -/* To generate biological details of an user */ -const userData = require('pirated-data'); - var biology = userData.BiologicalData(); - -/* To generate Address of an user */ -const userData = require('pirated-data'); -var address = userData.addressGenerator(); - -/* To generate huge set of biological data */ const userData = require('pirated-data'); -const desirednumber = 10; -var bnchBio = userData.hugeBiologicalDataGenerator(desirednumber); -console.log(bnchBio); -It will generate the 10 sets of user data. - -/* To generate huge set of Address data */ +``` +Example :
+``` const userData = require('pirated-data'); -const desirednumber = 10; -var bnchAddress = userData.hugeAddressGenerator(desirednumber); -console.log(bnchAddress); +let fulName = userData.userIdGenerator(); + console.log("pirated data test: ",fulName); ``` +### Check the below table for function list and use JavaScript function +| Function Name | Java | JavaScript | +|---|---|---| +| firstNameGenerator() | Yes | Yes | +| lastNameGenerator() | Yes | Yes | +| fullNameGenerator() | Yes | Yes | +| mobileNumberGenerator() | Yes | Yes | +| aadharNumberGenerator() | Yes | Yes | +| emailIdGenerator() | Yes | Yes | +| userIdGenerator() | Yes | Yes | +| passwordGenerator(int length) | Yes | Yes | +| randomNumberGenerator() | Yes | No | +| randomNumberGenerator(int MaxNumber) | Yes | Yes | +| panCardId() | Yes | Yes | +| upiIdGenerator() | Yes | Yes | +| hairColorGenerator() | Yes | Yes | +| genderGenerator() | Yes | Yes | +| birthDateTimeGenerator() | Yes | Yes | +| eyeColorGenerator() | Yes | Yes | +| bloodGroupGenerator() | Yes | Yes | +| skinColorGenerator() | Yes | Yes | +| weightGenerator() | Yes | Yes | +| ageCalculation() | Yes | Yes | +| passportNumber() | Yes | Yes | +| drivinglicenseGenerator() | No | Yes | +| BiologicalData() | No | Yes | +| stateGenerator() | No | Yes | +| distGenerator() | No | Yes | +| addressGenerator() | No | Yes | +| financialCardGenerator() | No | Yes | +| hugeAddressGenerator(desiredDataSetNumber) | No | Yes | +| hugeBiologicalDataGenerator(desiredDataSetNumber) | No | Yes | ## Need More feature _________________________________ If you want to more feature of this package just create an issue [Here.](https://github.com/satya319/pirated-data/issues) From fce62c1ce17cfbe67a82972e95b67c27c5619f9c Mon Sep 17 00:00:00 2001 From: satya319 Date: Sun, 21 Aug 2022 22:45:08 +0530 Subject: [PATCH 6/6] bug fix for functions --- JavaScript/package/index.js | 52 ++++++++++++++++----------------- JavaScript/package/package.json | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/JavaScript/package/index.js b/JavaScript/package/index.js index 6afef1a..0d21533 100644 --- a/JavaScript/package/index.js +++ b/JavaScript/package/index.js @@ -3,7 +3,7 @@ */ const { firstMaleName, title, emlDomain, upiDomain, gender, hairColor, skinColor, bloodGroup, eyeColor, stateName, stateDist, - stateList,stateRtoCode,stateRtoCount } = require('./dataProvider.js'); + stateList, stateRtoCode, stateRtoCount } = require('./dataProvider.js'); let actfirName = ""; let actlstName = ""; @@ -19,8 +19,8 @@ let actSkinColor = ""; let actStateName = ""; let actDistName = ""; let actCardFullDetails = ""; -let actUpiId=""; -let actMobileNumber=""; +let actUpiId = ""; +let actMobileNumber = ""; let firstDate1 = ""; let actAge = ""; let secondDate = new Date(2012, 4, 12);// every year to be increase one year. @@ -95,13 +95,13 @@ exports.emailIdGenerator = emailIdGenerator; * This function can generate random upi Id. * @returns upiId */ -function upiIdGenerator(){ -if(actMobileNumber==""){ - this.mobileNumberGenerator(); -} -let upiIdIndex = Math.floor(Math.random() * 35); -actUpiId = actMobileNumber + upiDomain[upiIdIndex]; -return actUpiId; +function upiIdGenerator() { + if (actMobileNumber == "") { + this.mobileNumberGenerator(); + } + let upiIdIndex = Math.floor(Math.random() * 35); + actUpiId = actMobileNumber + upiDomain[upiIdIndex]; + return actUpiId; } exports.upiIdGenerator = upiIdGenerator; /** @@ -171,28 +171,28 @@ exports.passportNumber = passportNumber; * This function generates the random Driving license number. * @returns */ -function drivinglicenseGenerator(){ +function drivinglicenseGenerator() { if (actStateName == "") { this.stateGenerator(); } - if(actStateName){ -var rtoCode = stateRtoCode[actStateName]; + if (actStateName) { + var rtoCode = stateRtoCode[actStateName]; } - if(actStateName){ - let rtoNum = Math.floor(Math.random() * stateRtoCount[actStateName]); - // actDistName = stateDist[actStateName]; - if(rtoNum >=1 && rtoNum<10){ - rtoNum ="0" + rtoNum ; - } - else if(rtoNum == 0){ - rtoNum ="01"; - } + if (actStateName) { + var rtoNum = Math.floor(Math.random() * stateRtoCount[actStateName]); + // actDistName = stateDist[actStateName]; + if (rtoNum >= 1 && rtoNum < 10) { + rtoNum = "0" + rtoNum; + } + else if (rtoNum == 0) { + rtoNum = "01"; + } } const yr = Math.floor(Math.random() * (2022 - 1998 + 1)) + 1998; const appNo = Math.floor(Math.random() * (8888888 - 1000000 + 1)) + 1000000; const dl = rtoCode + rtoNum + yr + appNo; let dlNum; - return dlNum = dl; + return dlNum = dl; } exports.drivinglicenseGenerator = drivinglicenseGenerator; @@ -222,7 +222,7 @@ function birthDateTimeGenerator() { const dy = firstDate2[2]; firstDate1 = yr + "-" + mn + "-" + dy; return firstDate1; - + } exports.birthDateTimeGenerator = birthDateTimeGenerator; /** @@ -408,7 +408,7 @@ function distGenerator() { if (actStateName == "") { this.stateGenerator(); } - if(actStateName){ + if (actStateName) { let dis = Math.floor(Math.random() * stateList[actStateName]); actDistName = stateDist[actStateName][dis] } @@ -500,7 +500,7 @@ exports.hugeBiologicalDataGenerator = hugeBiologicalDataGenerator; * This function generate random number 0 to 999999999999 * @returns randomNumber */ - function randomNumberGenerator(maxNumber){ +function randomNumberGenerator(maxNumber) { var number = Math.floor(Math.random() * maxNumber); return number; } diff --git a/JavaScript/package/package.json b/JavaScript/package/package.json index bf3fc7a..b17e982 100644 --- a/JavaScript/package/package.json +++ b/JavaScript/package/package.json @@ -1,6 +1,6 @@ { "name": "pirated-data", - "version": "2.0.03", + "version": "2.0.04", "description": "Generating sample user data like name, age, mobilenumber, aadharnumber etc for testing.", "main": "index.js", "scripts": {