
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
A js mask simple like killing zombies =).
Install it from npm using npm install --save tinymask
var TinyMask = require('tinymask')
var maskInstance = TinyMask('9999-9999');
var result = maskInstance.mask('12345678');
console.log(result); //1234-5678
By default, we use this translation:
9
-> Accept numbersA
-> Accept alphaS
-> Accept alphanumerics*
-> Accept allYou can pass options for the mask. We use the defaults:
var maskInstance = TinyMask('9999-9999', {
translation: {
'9': function (val) {
return val.replace(/[^0-9]+/g, '');
},
'A': function (val) {
return val.replace(/[^a-zA-Z]+/g, '');
},
'S': function (val) {
return val.replace(/[^a-zA-Z0-9]+/g, '');
},
'*': function (val) {
return val;
}
},
invalidValues: [null, undefined, '']
});
translation (Object | optional)
You can add or override any of the translation keys. Ex:
var maskInstance = TinyMask('9999-9999', {
translation: {
// in this case, we add new # translation that allow
// blank spaces.
'#': function (val) {
if (val === ' ') {
return val;
}
return null;
},
// here we override the * translation to accept only
// some characters instead all characters.
'*': function (val) {
if (['*', '!', '?'].indexOf(val) >= 0) {
return val;
}
return null;
}
}
});
invalidValues (Array | optional)
You can set ignored value. If any translation result on one of this values, that will be ignored.
var maskInstance = TinyMask('9999-9999', {
// in this case, all null, undefined, empty string or blanck spaces returned from translation will be ignored.
invalidValues: [null, undefined, '', ' ']
});
FAQs
A js mask simple like killing zombies =).
We found that tinymask demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.