diff --git a/define.go b/define.go index 9b53558..bcff167 100644 --- a/define.go +++ b/define.go @@ -14,4 +14,6 @@ const ( TypeMail = "MAIL_DATA_MASK" // TypePhone 手机号脱敏 TypePhone = "PHONE_DATA_MASK" + // TypePassword 密码数据脱敏 + TypePassword = "PASSWORD_DATA_MASK" ) diff --git a/password.go b/password.go new file mode 100644 index 0000000..54dbdd0 --- /dev/null +++ b/password.go @@ -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 +}