Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
inet_xtoy
Advanced tools
Readme
inet_ntop()
and inet_pton()
bindings for Node.js
npm install inet_xtoy
const { inet_ntop, inet_pton } = require('inet_xtoy');
console.log(inet_pton('127.0.0.1'));
console.log(inet_pton('::1'));
console.log(inet_ntop(inet_pton('127.0.0.1')));
console.log(inet_ntop(inet_pton('::1')));
inet_ntop(buf) converts an IPv4 or IPv6 address buf
from binary to text form.
buf
is expected to be a 4 (IPv4) or 16 (IPv6) bytes long String or Buffer.
Returns the IP address as a string or throws an Error in case the call to inet_ntop(3)
fails.
Throws TypeError
when the number of arguments is not 1, or when buf
is neither String nor Buffer, or when the length of buf
si neither 4 nor 16.
inet_pton(ip) converts an IPv4 or IPv6 address buf
from text to binary form.
ip
is expected to be a string. If ip
is not a valid IP address, the function returns null
.
Returns Buffer
with binary form of the given ip
, the length of the buffer is either 4 or 16 bytes.
Throws TypeError
when the number of arguments is not 1, or when ip
is not a string.
Throws Error
when a call to inet_pton(3)
fails.
FAQs
inet_ntop() and inet_pton() bindings for Node.js
The npm package inet_xtoy receives a total of 152 weekly downloads. As such, inet_xtoy popularity was classified as not popular.
We found that inet_xtoy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.