From 04c0d2930028f344df2c42292850d9c388c5ff1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Wed, 24 May 2023 15:04:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=86=E7=A0=81=E8=84=B1=E6=95=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- define.go | 2 ++ password.go | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 password.go 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 +}