feat: add Go backend
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package encrypt
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestMasking(t *testing.T) {
|
||||
if got := MaskMobile("13800000001"); got != "138****0001" {
|
||||
t.Fatalf("mobile mask: %s", got)
|
||||
}
|
||||
if got := MaskName("测试会员"); got != "测***" {
|
||||
t.Fatalf("name mask: %s", got)
|
||||
}
|
||||
if got := MaskAccount("6222020202020202001"); got != "6222***********2001" {
|
||||
t.Fatalf("account mask: %s", got)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user