MCPcopy Create free account
hub / github.com/ClydeTime/Surge / hideSensitiveData

Function hideSensitiveData

Script/Task/CCBLife.js:298–304  ·  view source on GitHub ↗
(string, head_length = 2, foot_length = 2)

Source from the content-addressed store, hash-verified

296
297// 数据脱敏
298function hideSensitiveData(string, head_length = 2, foot_length = 2) {
299 let star = '';
300 for (var i = 0; i < string.length - head_length - foot_length; i++) {
301 star += '*';
302 }
303 return string.substring(0, head_length) + star + string.substring(string.length - foot_length);
304}
305
306
307// prettier-ignore

Callers 3

CCBLife.jsFile · 0.85
autoLoginFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected