New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

llibclassification

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

llibclassification

This is a simple library to parse, encode and match IP addresses.

  • 1.0.0
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

IPv4/IPv6 Address Library

This is a simple library to parse, encode and match IP addresses.

IPv4 Class

IPv4 Getters

a-d: number

Gets the 1-4'th byte.

binary: number[]

Gets the bytes of the address.

cidr_range: number

Gets the possibly parsed CIDR range.

cidr: boolean

If the address is a CIDR range.

IPv4 Static Methods

decode(raw: string): IPv4Address

Parses the raw IPv4 address (possible CIDR Range) and returns the address.

IPv4 Methods

encode(): string

Encodes the current address (possible CIDR range) to an string.

cidr_match(cidr: IPv4Address): boolean

Checks if the current address is in the given range.

equals(other: IPv4Address): boolean

Checks if the current address quals the other.

IPv6 class

IPv6 Getters

cidr_range

Gets the CIDR range if there.

cidr

Checks if the address is a CIDR range.

pairs

Gets all the IPv6 Pairs (2-byte pairs)

bytes

Gets the bytes array of the address.

Binary

Gets the binary version of the address (128-bit bigint).

IPv6 Static Methods

decode(raw: string): IPv6Address

Decodes the given raw IPv6 address / CIDR range, and returns it as an address class.

IPv6 Method

encode(): string

Encodes the current address to a string.

cidr_match(cidr: IPv6Address): boolean

Checks if the current address is in the given CIDR range.

equals(other: IPv6Address): boolean

Checks if both addresses are equal.

FAQs

Package last updated on 01 Apr 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc