New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

random-ip

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-ip

generate random ip(v4 or v6) addresses

latest
npmnpm
Version
0.0.1
Version published
Weekly downloads
234
-34.27%
Maintainers
1
Weekly downloads
 
Created
Source

random-ip

generate random ip(v4 or v6) addresses

why

just playing around with ipv6 and wanted to be able to generate addresses in arbitrary ranges

how

  • depends on @indutny's node-ip to parse ip addresses
  • uses Math.random() to randomly twiddle bits within in the CIDR range you specify

example

var randomip = require('random-ip');

// ipv6
randomip('::', 64)                    // 0:0:0:0:f46c:cde1:a409:d38f
randomip('::', 64, 80)                // 0:0:0:0:9eba:0:0:0
randomip('2001:470:e01::', 48, 64)    // 2001:470:e01:da2f:0:0:0:0

// ipv4
randomip('0.0.0.0', 24)               // 0.0.0.136
randomip('0.0.0.0', 16, 24)           // 0.0.68.0
randomip('192.168.2.0', 24)           // 192.168.2.240

test

node test

npm

npm install random-ip

license

WTFPL

FAQs

Package last updated on 29 Jan 2014

Did you know?

Socket

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.

Install

Related posts