Liking cljdoc? Tell your friends :D

io.randomseed.utils.ip

Random utils, IP address support functions.

Random utils, IP address support functions.
raw docstring

addressclj

(address s)
(address a b c d)
(address a b c d e f g h i j k l m n o p)

Converts the given value to an IP address. Can work with strings, byte arrays, sequences of bytes and numbers. When 4 (for IPv4) or 16 (for IPv6) arguments are given, they should be a bytes or values which may be converted to (unchecked) bytes.

Converts the given value to an IP address. Can work with strings, byte arrays,
sequences of bytes and numbers. When 4 (for IPv4) or 16 (for IPv6) arguments are
given, they should be a bytes or values which may be converted to (unchecked)
bytes.
sourceraw docstring

bytes-to-addressclj

(bytes-to-address b)
(bytes-to-address b & bytes)

Coverts a byte array to an IP address. If there are 4 bytes are less, an IPv4 address will be created, otherwise IPv6. When more than one argument is given, it will create a byte array, converting each argument's value to an unchecked byte. Will throw an exception if a number given for a byte is lesser than 0 or greater than 255.

Coverts a byte array to an IP address. If there are 4 bytes are less, an IPv4
address will be created, otherwise IPv6. When more than one argument is given, it
will create a byte array, converting each argument's value to an unchecked
byte. Will throw an exception if a number given for a byte is lesser than 0 or
greater than 255.
sourceraw docstring

bytes-to-ipv4clj

(bytes-to-ipv4 b)
(bytes-to-ipv4 a b c d)

Creates new IPv4 address using an array of bytes. When 4 arguments are given, they will be used to create a byte array. Will throw an exception if a number given for a byte is lesser than 0 or greater than 255.

Creates new IPv4 address using an array of bytes. When 4 arguments are given, they
will be used to create a byte array. Will throw an exception if a number given for
a byte is lesser than 0 or greater than 255.
sourceraw docstring

bytes-to-ipv6clj

(bytes-to-ipv6 b)
(bytes-to-ipv6 a b c d e f g h i j k l m n o p)

Creates new IPv6 address using an array of bytes. When 16 arguments are given, they will be used to create a byte array. Will throw an exception if a number given for a byte is lesser than 0 or greater than 255.

Creates new IPv6 address using an array of bytes. When 16 arguments are given, they
will be used to create a byte array. Will throw an exception if a number given for
a byte is lesser than 0 or greater than 255.
sourceraw docstring

in4t?clj

(in4t? trie ip)

Returns true if an IPv6 address is contained within the given tree.

Returns `true` if an IPv6 address is contained within the given tree.
sourceraw docstring

in6t?clj

(in6t? trie ip)

Returns true if an IPv6 address is contained within the given tree.

Returns `true` if an IPv6 address is contained within the given tree.
sourceraw docstring

inet-address?clj

(inet-address? v)

Returns true if the given value is of a type java.net.InetAddress.

Returns `true` if the given value is of a type `java.net.InetAddress`.
sourceraw docstring

ip?clj

(ip? v)

Returns true if the given value (a string, a number, a sequence of bytes, or an IP address object) represents a valid IP address.

Returns `true` if the given value (a string, a number, a sequence of bytes, or an IP
address object) represents a valid IP address.
sourceraw docstring

ipv4-mapped?clj

(ipv4-mapped? v)

Returns true if the given value (a string, a number, a sequence of bytes, or an IP address object) represents a valid IPv4 address and it is a IPv4-mapped IPv6 address.

Returns `true` if the given value (a string, a number, a sequence of bytes, or an IP
address object) represents a valid IPv4 address and it is a IPv4-mapped IPv6 address.
sourceraw docstring

ipv4?clj

(ipv4? v)

Returns true if the given value (a string, a number, a sequence of bytes, or an IP address object) represents a valid IPv4 address.

Returns `true` if the given value (a string, a number, a sequence of bytes, or an IP
address object) represents a valid IPv4 address.
sourceraw docstring

ipv6?clj

(ipv6? v)

Returns true if the given value (a string, a number, a sequence of bytes, or an IP address object) represents a valid IPv6 address.

Returns `true` if the given value (a string, a number, a sequence of bytes, or an IP
address object) represents a valid IPv6 address.
sourceraw docstring

is-ip?clj

(is-ip? v)

Returns true if the given value is of type inet.ipaddr.IPAddress.

Returns `true` if the given value is of type `inet.ipaddr.IPAddress`.
sourceraw docstring

is-ipv4-mapped?clj

(is-ipv4-mapped? v)

Returns true if the given value is of type inet.ipaddr.ipv6.IPv6Address and it is IPv4-mapped address.

Returns `true` if the given value is of type `inet.ipaddr.ipv6.IPv6Address` and
it is IPv4-mapped address.
sourceraw docstring

is-ipv4?clj

(is-ipv4? v)

Returns true if the given value is of type inet.ipaddr.ipv4.IPv4Address.

Returns `true` if the given value is of type `inet.ipaddr.ipv4.IPv4Address`.
sourceraw docstring

is-ipv6?clj

(is-ipv6? v)

Returns true if the given value is of type inet.ipaddr.ipv6.IPv6Address.

Returns `true` if the given value is of type `inet.ipaddr.ipv6.IPv6Address`.
sourceraw docstring

java-inet-to-addressclj

(java-inet-to-address v)

Converts java.net.InetAddress to IP address.

Converts `java.net.InetAddress` to IP address.
sourceraw docstring

number-to-addressclj

(number-to-address n)

Coverts a number to an IP address. If the number is a kind of java.math.BigInteger or clojure.lang.BigInt, the IPv6 address will be created. Otherwise the number will be converted to int and IPv4 address will be created.

Coverts a number to an IP address. If the number is a kind of `java.math.BigInteger`
or `clojure.lang.BigInt`, the IPv6 address will be created. Otherwise the number
will be converted to `int` and IPv4 address will be created.
sourceraw docstring

number-to-ipv4clj

(number-to-ipv4 n)

Coverts a number to an IPv4 address.

Coverts a number to an IPv4 address.
sourceraw docstring

number-to-ipv6clj

(number-to-ipv6 n)

Coverts a number to an IPv6 address.

Coverts a number to an IPv6 address.
sourceraw docstring

plain-ipclj

(plain-ip ip)

Returns an IP address. If the address can be expressed as IPv4, it is returned as IPv4, otherwise as IPv6.

Returns an IP address. If the address can be expressed as IPv4, it is returned as
IPv4, otherwise as IPv6.
sourceraw docstring

plain-ip-strclj

(plain-ip-str ip)

Returns string representation of IP address (if the address can be expressed as IPv4, it is returned as 4 octets in dotted-decimal notation, otherwise IPv6 representation is returned).

Returns string representation of IP address (if the address can be expressed as
IPv4, it is returned as 4 octets in dotted-decimal notation, otherwise IPv6
representation is returned).
sourceraw docstring

preprocess-ip-listclj

(preprocess-ip-list p)

Takes a sequence of IP addresses and returns a vector of Trie trees with IP address ranges.

Takes a sequence of IP addresses and returns a vector of Trie trees with IP address
ranges.
sourceraw docstring

string-to-addressclj

(string-to-address s)

Coverts a string to an IP address.

Coverts a string to an IP address.
sourceraw docstring

to-addressclj

(to-address s)
(to-address a b c d)
(to-address a b c d e f g h i j k l m n o p)

Converts the given value to an IP address. Can work with strings, byte arrays, sequences of bytes and numbers. When 4 (for IPv4) or 16 (for IPv6) arguments are given, they should be a bytes or values which may be converted to (unchecked) bytes.

Converts the given value to an IP address. Can work with strings, byte arrays,
sequences of bytes and numbers. When 4 (for IPv4) or 16 (for IPv6) arguments are
given, they should be a bytes or values which may be converted to (unchecked)
bytes.
sourceraw docstring

to-strclj

(to-str ip)

Converts IP address to a string. Returns nil if it is not possible.

Converts IP address to a string. Returns `nil` if it is not possible.
sourceraw docstring

to-str-plainclj

(to-str-plain ip)

Returns string representation of IP address (if the address can be expressed as IPv4, it is returned as 4 octets in dotted-decimal notation, otherwise IPv6 representation is returned).

Returns string representation of IP address (if the address can be expressed as
IPv4, it is returned as 4 octets in dotted-decimal notation, otherwise IPv6
representation is returned).
sourceraw docstring

to-str-v4clj

(to-str-v4 ip)

Converts IP address to a string expressing IPv4 notation. Returns nil if this is not possible.

Converts IP address to a string expressing IPv4 notation. Returns `nil` if this is
not possible.
sourceraw docstring

to-str-v6clj

(to-str-v6 ip)

Converts IP address to a string expressing IPv6 notation. Returns nil if this is not possible.

Converts IP address to a string expressing IPv6 notation. Returns `nil` if this is
not possible.
sourceraw docstring

to-stringclj

(to-string ip)

Converts IP address to a string. Returns nil if it is not possible.

Converts IP address to a string. Returns `nil` if it is not possible.
sourceraw docstring

to-string-v4clj

(to-string-v4 ip)

Converts IP address to a string expressing IPv4 notation. Returns nil if this is not possible.

Converts IP address to a string expressing IPv4 notation. Returns `nil` if this is
not possible.
sourceraw docstring

to-string-v6clj

(to-string-v6 ip)

Converts IP address to a string expressing IPv6 notation. Returns nil if this is not possible.

Converts IP address to a string expressing IPv6 notation. Returns `nil` if this is
not possible.
sourceraw docstring

to-v4clj

(to-v4 v)

Converts the given IP address to IPv4. Returns nil if this is not possible.

Converts the given IP address to IPv4. Returns `nil` if this is not possible.
sourceraw docstring

to-v6clj

(to-v6 v)

Converts the given IP address to IPv6. Returns nil if this is not possible.

Converts the given IP address to IPv6. Returns `nil` if this is not possible.
sourceraw docstring

ubyteclj

(ubyte v)

Converts to an unchecked byte used to express unsigned values. Throws an IllegalArgumentException exception if the given value is not a byte but exceeds the range of 0-255.

Converts to an unchecked byte used to express unsigned values. Throws an
`IllegalArgumentException` exception if the given value is not a byte but exceeds
the range of 0-255.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close