-
Notifications
You must be signed in to change notification settings - Fork 0
Add 14 generator types to meet the 60+ claim documented on the website #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -104,6 +104,20 @@ class GeneratorService( | |||||
| GeneratorType.LICENSE_PLATE -> faker.vehicle().licensePlate() | ||||||
| GeneratorType.ORGANIZATION -> faker.company().name() | ||||||
| GeneratorType.ACCOUNT_NUMBER -> faker.regexify("[0-9]{10}") | ||||||
| GeneratorType.TITLE -> faker.name().prefix() | ||||||
| GeneratorType.JOB_TITLE -> faker.job().title() | ||||||
| GeneratorType.NATIONALITY -> faker.nation().nationality() | ||||||
| GeneratorType.COMPANY_NAME -> faker.company().name() | ||||||
| GeneratorType.DEPARTMENT -> faker.commerce().department() | ||||||
| GeneratorType.CURRENCY_CODE -> faker.currency().code() | ||||||
| GeneratorType.DOMAIN_NAME -> faker.internet().domainName() | ||||||
| GeneratorType.USER_AGENT -> faker.internet().userAgent().replace(Regex("\\s+"), " ") | ||||||
| GeneratorType.LATITUDE -> faker.address().latitude() | ||||||
| GeneratorType.LONGITUDE -> faker.address().longitude() | ||||||
| GeneratorType.TIME_ZONE -> faker.address().timeZone() | ||||||
| GeneratorType.BOOLEAN -> faker.bool().bool() | ||||||
| GeneratorType.LOREM -> faker.lorem().paragraph() | ||||||
| GeneratorType.TIMESTAMP -> java.sql.Timestamp(faker.date().past(365 * 10, java.util.concurrent.TimeUnit.DAYS).time) | ||||||
|
||||||
| GeneratorType.TIMESTAMP -> java.sql.Timestamp(faker.date().past(365 * 10, java.util.concurrent.TimeUnit.DAYS).time) | |
| GeneratorType.TIMESTAMP -> java.sql.Timestamp(faker.date().past(365 * 10, TimeUnit.DAYS).time) |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -159,6 +159,10 @@ OpenDataMask includes 60+ built-in generators. Key examples: | |||||
| | `IP_ADDRESS` | `192.168.1.42` | | ||||||
| | `ICD_CODE` | `J45.909` | | ||||||
| | `IBAN` | `GB29NWBK60161331926819` | | ||||||
| | `JOB_TITLE` | `Senior Software Engineer` | | ||||||
| | `NATIONALITY` | `Canadian` | | ||||||
| | `DOMAIN_NAME` | `example.com` | | ||||||
| | `TIMESTAMP` | `2024-06-15 14:30:00` | | ||||||
|
||||||
| | `TIMESTAMP` | `2024-06-15 14:30:00` | | |
| | `TIMESTAMP` | `2024-06-15 14:30:00.0` | |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,12 +130,14 @@ <h2 id="generators">Generator Types</h2> | |
| <p>OpenDataMask includes 60+ built-in generators covering personal, financial, medical, and network data:</p> | ||
| <table> | ||
| <tr><th>Category</th><th>Generators</th></tr> | ||
| <tr><td>Personal</td><td>NAME, FIRST_NAME, LAST_NAME, EMAIL, PHONE, BIRTH_DATE, GENDER</td></tr> | ||
| <tr><td>Address</td><td>ADDRESS, STREET_ADDRESS, CITY, STATE, ZIP_CODE, COUNTRY, GPS_COORDINATES</td></tr> | ||
| <tr><td>Personal</td><td>NAME, FIRST_NAME, LAST_NAME, EMAIL, PHONE, BIRTH_DATE, GENDER, TITLE, JOB_TITLE, NATIONALITY</td></tr> | ||
| <tr><td>Address</td><td>ADDRESS, STREET_ADDRESS, CITY, STATE, ZIP_CODE, COUNTRY, GPS_COORDINATES, LATITUDE, LONGITUDE, TIME_ZONE</td></tr> | ||
|
Comment on lines
+133
to
+134
|
||
| <tr><td>Identity</td><td>SSN, PASSPORT_NUMBER, DRIVERS_LICENSE, MEDICAL_RECORD_NUMBER</td></tr> | ||
| <tr><td>Financial</td><td>CREDIT_CARD, IBAN, SWIFT_CODE, MONEY_AMOUNT, BTC_ADDRESS, ACCOUNT_NUMBER</td></tr> | ||
| <tr><td>Network</td><td>IP_ADDRESS, IPV6_ADDRESS, MAC_ADDRESS, URL</td></tr> | ||
| <tr><td>Financial</td><td>CREDIT_CARD, IBAN, SWIFT_CODE, MONEY_AMOUNT, BTC_ADDRESS, ACCOUNT_NUMBER, CURRENCY_CODE</td></tr> | ||
| <tr><td>Network</td><td>IP_ADDRESS, IPV6_ADDRESS, MAC_ADDRESS, URL, DOMAIN_NAME, USER_AGENT</td></tr> | ||
| <tr><td>Business</td><td>ORGANIZATION, COMPANY_NAME, DEPARTMENT</td></tr> | ||
| <tr><td>Medical</td><td>ICD_CODE, HEALTH_PLAN_NUMBER</td></tr> | ||
| <tr><td>Data Utilities</td><td>BOOLEAN, LOREM, TIMESTAMP</td></tr> | ||
| <tr><td>Control</td><td>NULL, CONSTANT, PARTIAL_MASK, FORMAT_PRESERVING, SEQUENTIAL, RANDOM_INT</td></tr> | ||
| </table> | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
USER_AGENTgeneration compiles a newRegex("\\s+")on every call viareplace(Regex(...)), which can be a hot path when generating large datasets. Consider using a precompiled regex constant (e.g., in acompanion object) or an alternative that avoids per-call regex construction.