anonymize-ip
v1.0.1
Published
Hide last ip numbers for given ip, like `129.89.5.243` -> `129.89.x.xxx` or `79.100.175.45` to `79.100.xxx.xx`. Or replace them with custom mask.
Downloads
35
Readme
Hide last ip numbers for given ip, like
129.89.5.243
->129.89.x.xxx
or79.100.175.45
to79.100.xxx.xx
. Or replace them with custom mask.
Install
npm i --save anonymize-ip
npm test
API
For more use-cases see the tests
anonymizeIp
Anonymize given ip address.
<ip>
{String} valid ip address[mask]
{String} symbol to replace withreturn
{String}
Example:
var anonymizeIp = require('anonymize-ip');
anonymizeIp('79.100.75.145');
//=> 79.100.xx.xxx
anonymizeIp('231.77.134.6', '*');
//=> 231.77.***.*
anonymizeIp('129.89.5.243', '_');
//=> 129.89._.___
anonymizeIp('92.189.231.21', [1,2,3]);
//=> 92.189.xxx.xx
Author
Charlike Mike Reagent
License
Copyright (c) 2014-2015 Charlike Mike Reagent, contributors.
Released under the MIT
license.
Powered and automated by kdf, February 3, 2015