HYDRA:量化用于低轨卫星网络高效链路洪泛攻击的僵尸网络资源阈值
2026/10/1 10:10:28
// 获取 * 字符串 var _getStartStr = function (startLen) { var startStr = ''; while (startLen > 0) { startStr += '*'; startLen--; } return startStr; } /** * 根据脱敏规则转换数据格式 * @param {*} type * @param {*} value * @returns */ var _tmByType = function (type, value) { var tmValue = ''; var valueLength = value.length; if (_getVals(value).length > 1) { return value; } if (!value || !type) return; switch (type) { case 'fixedMobile': var fixedTel = /^\d{3,4}-\d{7,8}$/.test(value) || /^\d{10,12}$/.test(value); var mobile = /^1[3456789]\d{9}$/.test(value); if (fixedTel) { tmValue = value.replace(/.(?=....)/g, '*'); } else if (mobile) { var startStr = _getStartStr(valueLength - 7); tmValue = value.replace(/^(.{3}).+(.{4})$/, '$1' + startStr + '$2');