package com.tms.common.utils;
import com.baomidou.mybatisplus.toolkit.StringUtils;
public class EncryptionUtils {
public static final int ONE = 1;
public static final int TWO = 2;
public static String desensitizedName(String str) {
if (str == null) {
return null;
}
if (str.length() == ONE) {
return str;
} else if (str.length() == TWO) {
return str.substring(0, 1) +"*";
} else {
Integer length = str.length();
StringBuffer middle = new StringBuffer();
for (int i = 0; i < str.substring(1, length - 1).length(); i++) {
middle.append("*");
}
return str.substring(0, 1)