密码脱敏

This commit is contained in:
白茶清欢 2023-05-24 15:04:53 +08:00
parent 984657032d
commit 04c0d29300
2 changed files with 26 additions and 0 deletions

View File

@ -14,4 +14,6 @@ const (
TypeMail = "MAIL_DATA_MASK"
// TypePhone 手机号脱敏
TypePhone = "PHONE_DATA_MASK"
// TypePassword 密码数据脱敏
TypePassword = "PASSWORD_DATA_MASK"
)

24
password.go Normal file
View File

@ -0,0 +1,24 @@
// Package data_mask ...
//
// Description : data_mask ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2023-05-24 15:02
package data_mask
// PasswordDataMask 密码数据脱敏
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 15:04 2023/5/24
type PasswordDataMask struct {
}
func (p PasswordDataMask) Mask(input string) string {
return "********"
}
func (p PasswordDataMask) Type() string {
return TypePassword
}