Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
A utility allowing an easy conversion between IP addresses and integers.
An IPv4 address is technically a 32-bit integer that is commonly represented by a string in the format 0.0.0.0. Similarly, IPv6 addresses are 128-bit integers that are commonly represented by a string in the format 0:0:0:0:0:0:0:0.
The ability to convert between these two representations make it easier to iterate over a large number of IP addresses.
npm install toip
yarn add toip
pnpm add toip
const { toIPv4 } = require('toip');
console.log(toIPv4(0)); //prints out 0.0.0.0
console.log(toIPv4(1)); //prints out 0.0.0.1
console.log(toIPv4(4294967295)); //prints out 255.255.255.255
import { toIPv4 } from 'toip';
console.log(toIPv4(0)); //prints out 0.0.0.0
console.log(toIPv4(1)); //prints out 0.0.0.1
console.log(toIPv4(4294967295)); //prints out 255.255.255.255
toIPv4(number)
- Converts a number to an IPv4 address represented as string in format 0.0.0.0
.ipv4ToNumber(string)
- takes in an IPv4 address represented as a string in format 0.0.0.0
and returns the number representation.toIPv6(bigint)
- Converts a number to an IPv6 address represented as string in format fff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
or just ::
for the shorthand representation.ipv6ToNumber(string)
- Converts an IPv6 address string and converts it to a bigint
number.FAQs
Converts the IP addresses to their integer representation and vice versa.
The npm package toip receives a total of 18 weekly downloads. As such, toip popularity was classified as not popular.
We found that toip demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.