版权声明:技术有限,如有错误,请指出谢谢 作者:赵先森 出处:https://blog.csdn.net/weixin_37264997 版权所有,欢迎保留原文链接进行转载:) https://blog.csdn.net/weixin_37264997/article/details/90639074
为了保护客户隐私时常会用到脱敏等操作,下面就介绍几种数据脱敏的方式
JAVA
public static void main(String[] args) { String phone = "18888888888"; String phoneNumber = phone.substring(0, 3) + "****" + phone.substring(7, phone.length()); System.out.println("phone总长度:" + phone.length()); System.out.println("phone前3位:" + phone.substring(0, 3)); System.out.println("phone中4位:" + phone.substring(3, 7)); System.out.println("phone后4位:" + phone.substring(7, phone.length())); System.out.println("phone中4*:" + phoneNumber); }
SQL
SELECT INSERT ( 18888888888, 4, 4, '****' ) AS phone , INSERT ( '37292219960101555X', 5, 10, '****' ) AS ID FROM DUAL;
文章来源: https://blog.csdn.net/weixin_37264997/article/details/90639074