首页  编辑  

敏感信息用星号替代

Tags: /MySQL/   Date Created:

对电话号码,身份证号等关键信息用信号遮掩部分

SET @NUMBER = "13412345678";

SELECT LENGTH(@NUMBER) < 10, @NUMBER, CONCAT(SUBSTR(@NUMBER, 1, 8), REPEAT('*', LENGTH(@NUMBER) - 7))