|
@@ -0,0 +1,17 @@
|
|
|
+package regular
|
|
|
+
|
|
|
+import "regexp"
|
|
|
+
|
|
|
+
|
|
|
+func MaskPhoneNumber(phoneNumber string) string {
|
|
|
+
|
|
|
+ re := regexp.MustCompile(`(\d{3})\d{4}(\d{4})`)
|
|
|
+ return re.ReplaceAllString(phoneNumber, "$1****$2")
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+func MaskIDNumber(idNumber string) string {
|
|
|
+
|
|
|
+ re := regexp.MustCompile(`(\d{3})\d+(\d{4})`)
|
|
|
+ return re.ReplaceAllString(idNumber, "$1********$2")
|
|
|
+}
|