mask-sensitive
v0.0.7
Published
mask sensitive data
Downloads
177
Readme
Mask sensitive
Masks sensitive data with several different methods.
Installation
npm install mask-sensitive
Usage
var mask = require('mask-sensitive');
var password = 'very sensitive data';
var masked = mask(password, {mode: 'secure'});
Modes
secure
- return***
;length
- return equal to length number of*
;half
- mask first and last 1/4;every
- mask every third char;middle
- replace middle with***
;
By default, secure
method is used.
Important
- All data less then 4 chars will be masked with
secure
mode; - null is masked as ***.