-
Notifications
You must be signed in to change notification settings - Fork 51
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
Dont randomize the first charachters #74
Comments
Hi Balogh, Thanks for trying out Anonimatron! The feature you are asking about is something that can be easily realized by making a simple Anonymizer and puting that on the classpath of Anonimatron. I haven't documented it very well, this may be a good trigger to do just that. If you have a bit of Java knowledge, you should be able to build a class like this which can generate the strings you want. Let me know if this helps. |
Hello. Can I take care of this task? |
You are more than welcome to. If you need help just give a shout! |
Thank you that would be great. Let me know if I can help in testing. |
Hi @realrolfje |
Personally I'd start with a separate class, maybe use the CharacterStringAnonymizer as a superclass to get you started. In our case, I see we also need digits. Maybe @baloght can tell us what type of data this is, like "phone number" or "address" or "name", so we know if we need only digits, only upper case characters, or mixed case. |
@baloght Does it meet your needs? |
Great work @BElluu , I've added my comments in a code review. |
@realrolfje where can I see you comments? Beucase in my pull request I do not see any conversation. In files changes do not see any comments too :) ---EDIT--- |
Yes sorry my fault, I posted the comment before I saved the review. Take your time, I haven't got a release schedule to keep :-) |
Hi @realrolfje Sorry but I only had time today to improve it. Could you verify if I did it correctly? |
Hi, sorry for the late reply. The column contains phone numbers so data always will be digit. |
Hi, thanks for working on it. |
Hi Baloght, Getting the same output for the same input is handled by Anonimatron, not the anonymizer. This is because it knows (loads) it's synonyms for each run. |
Working on getting it working for you. It generates consecutive digit strings now, keeping the first x digits of the original string. I have two questions:
|
I would like to call the function for msisdns (phone numbers from different countries) where the first x digits comes from the country code and provider ID. I want to keep the original country codes and provider IDs. In my case the format is always only digits, but if you think it could worth to add other options for special characters. Maybe those will come in handy for others, and the tool would be even more customizable. Maybe you don't like the idea, but I think that would be a nice feature, if users can add pattern as parameter for a given anonymization type. Then the digits 5553433478 would be 5552133659 after the anonymization. I think this method would be extremely customizable instead a 'keep first or last 5 characters' method. |
That is actually a brilliant idea! It makes it more flexible and also fixes my original question: If there is a dash or space in there, you can just mask it out and it will not be replaced with a number. I'll see if I can change it to your suggestions. I need to rename the class and type too, it will be worth it I think. |
I added it as a feature to the DigitStringAnonymizer we already have. Have a look at the javadoc of that method, does that look usable for you? |
Yes, it seems pretty fine. |
@realrolfje I saw you merged my branch. Sorry but I was too busy to doing something ;/ |
Hi @BElluu no problem, I was just a bit impatient, sorry ;-) Did you see Balogh's ideas about extending the DigitStringAnonymizer? It is a more flexible solution to Balogh's request. I may re-implement the loop to be faster, but I think this will do the trick. If you check out the feature/partial-character-anonymizer-cleanup branch you can play with it and let me know what you think. |
Re-implented the loop: 3 times faster :-) Happy with that. |
Released! Enjoy your new Anonymizer! |
Hi,
great tool, works fine!
Unfortunately I miss a feature. I would like to keep the first 3 chars/digits in a string.
5550123456789 --> 5551743025698
Is there any way to achieve this with the current code? If not, is there any plan you will deploy this feature later?
Cheers,
T
The text was updated successfully, but these errors were encountered: