Groovy 版 mask-pii

Groovy 版 mask-pii,用于在日志和数据管道中屏蔽邮箱和电话号码等 PII。

邮箱脱敏

在保留域名可见性的同时屏蔽本地部分。

电话脱敏

在保留格式和后四位可见性的同时屏蔽敏感数字。

构建器式 API

在处理前显式启用邮箱/电话屏蔽,并设置掩码字符。

安装与开始使用

Groovy [planned: Maven Central 0.2.0]: 使用下方当前的安装方式,加载 Groovy API 并运行最小示例。该示例会明确启用电子邮件和电话号码遮罩,并显示预期输出。

安装

git clone --branch v0.2.0 --depth 1 https://github.com/finitefield-org/mask-pii.git

使用

example.groovy
import org.finitefield.maskpii.Masker

def masker = new Masker()
    .maskEmails()
    .maskPhones()
    .withMaskChar('#')

def inputText = 'Contact: alice@example.com or 090-1234-5678.'
def output = masker.process(inputText)

println(output)
// => Contact: a####@example.com or ###-####-5678.
提示

请查看 README ,以获取该语言对应的包生态详情和 API 示例。

上一页

语言索引

下一页

GitHub