mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-03 09:10:01 +01:00
Improved email hiding method
This commit is contained in:
parent
67b4efa4ab
commit
cb60d7bd81
@ -34,10 +34,11 @@ public class ShowEmailCommand extends PlayerCommand {
|
|||||||
|
|
||||||
private String emailMask(String email){
|
private String emailMask(String email){
|
||||||
String[] frag = email.split("@"); //Split id and domain
|
String[] frag = email.split("@"); //Split id and domain
|
||||||
int sid = frag[0].length() / 3 + 1; //Define the id view
|
int sid = frag[0].length() / 3 + 1; //Define the id view (must be a value >= 1)
|
||||||
int sdomain = frag[1].length() / 3 + 1; //Define the domain view
|
String[] dom = frag[1].split("."); //Domain substrings
|
||||||
|
int sdomain = dom[0].length() / 3; //Define the domain view (must be a value >= 0)
|
||||||
String id = frag[0].substring(0, sid) + "*****"; //Build the id
|
String id = frag[0].substring(0, sid) + "*****"; //Build the id
|
||||||
String domain = "***" + frag[1].substring(sdomain); //Build the domain
|
String domain = "***" + dom[0].substring(sdomain) + "." + dom[1]; //Build the domain
|
||||||
return id + "@" + domain;
|
return id + "@" + domain;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user