truncate-ip
v1.0.1
Published
Protect users privacy by truncating their IP addresses
Downloads
4
Readme
truncate-ip
Dead simple, zero deps, 100% code coverage module to protect your users privacy by truncating their IP addresses.
This module truncates IPv4 to 24 bits and IPv6 to 48 bits.
Usage
const truncateIP = require('truncate-ip');
console.log(truncateIP('192.168.0.1')); // prints 192.168.0.
console.log(truncateIP('2001:0DB8:0000:0000:0000:0000:1428:57ab')); // prints 2001:0DB8:0000::