-
Notifications
You must be signed in to change notification settings - Fork 0
/
io.randomseed.utils.ip.html
38 lines (38 loc) · 25.5 KB
/
io.randomseed.utils.ip.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html PUBLIC ""
"">
<html><head><meta charset="UTF-8" /><title>io.randomseed.utils.ip documentation</title><link rel="stylesheet" type="text/css" href="css/default.css" /><link rel="stylesheet" type="text/css" href="css/highlight.css" /><script type="text/javascript" src="js/highlight.min.js"></script><script type="text/javascript" src="js/jquery.min.js"></script><script type="text/javascript" src="js/page_effects.js"></script><script>hljs.initHighlightingOnLoad();</script><link rel="stylesheet" type="text/css" href="css/randomseed.css" /></head><body><div id="header"><h2>Generated by <a href="https://github.com/weavejester/codox">Codox</a></h2><h1><a href="index.html"><span class="project-title"><span class="project-name">Random:utils</span> <span class="project-version">1.2.34</span></span></a></h1></div><div class="sidebar primary"><h3 class="no-link"><span class="inner">Project</span></h3><ul class="index-link"><li class="depth-1 "><a href="index.html"><div class="inner">Index</div></a></li></ul><h3 class="no-link"><span class="inner">Topics</span></h3><ul><li class="depth-1 "><a href="10_introduction.html"><div class="inner"><span>Introduction</span></div></a></li></ul><h3 class="no-link"><span class="inner">Namespaces</span></h3><ul><li class="depth-1"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>io</span></div></div></li><li class="depth-2"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>randomseed</span></div></div></li><li class="depth-3"><a href="io.randomseed.utils.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>utils</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bot.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bot</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.bus.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>bus</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.crypto.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>crypto</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.db.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>db</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.db.types.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>types</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.fs.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>fs</span></div></a></li><li class="depth-4 branch current"><a href="io.randomseed.utils.ip.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>ip</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.log.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>log</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.map.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>map</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.nop-cache.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>nop-cache</span></div></a></li><li class="depth-4"><div class="no-link"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>reitit</span></div></div></li><li class="depth-5"><a href="io.randomseed.utils.reitit.http.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>http</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.set.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>set</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.time.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>time</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.validators.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>validators</span></div></a></li><li class="depth-5"><a href="io.randomseed.utils.validators.common.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>common</span></div></a></li><li class="depth-4 branch"><a href="io.randomseed.utils.var.html"><div class="inner"><span class="tree" style="top: -52px;"><span class="top" style="height: 61px;"></span><span class="bottom"></span></span><span>var</span></div></a></li><li class="depth-4"><a href="io.randomseed.utils.vec.html"><div class="inner"><span class="tree"><span class="top"></span><span class="bottom"></span></span><span>vec</span></div></a></li></ul></div><div class="sidebar secondary"><h3><a href="#top"><span class="inner">Public Vars</span></a></h3><ul><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-address"><div class="inner"><span>address</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-bytes-to-address"><div class="inner"><span>bytes-to-address</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-bytes-to-ipv4"><div class="inner"><span>bytes-to-ipv4</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-bytes-to-ipv6"><div class="inner"><span>bytes-to-ipv6</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-in4t.3F"><div class="inner"><span>in4t?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-in6t.3F"><div class="inner"><span>in6t?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-inet-address.3F"><div class="inner"><span>inet-address?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-ip.3F"><div class="inner"><span>ip?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-ipv4-mapped.3F"><div class="inner"><span>ipv4-mapped?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-ipv4.3F"><div class="inner"><span>ipv4?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-ipv6.3F"><div class="inner"><span>ipv6?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-is-ip.3F"><div class="inner"><span>is-ip?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-is-ipv4-mapped.3F"><div class="inner"><span>is-ipv4-mapped?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-is-ipv4.3F"><div class="inner"><span>is-ipv4?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-is-ipv6.3F"><div class="inner"><span>is-ipv6?</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-java-inet-to-address"><div class="inner"><span>java-inet-to-address</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-number-to-address"><div class="inner"><span>number-to-address</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-number-to-ipv4"><div class="inner"><span>number-to-ipv4</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-number-to-ipv6"><div class="inner"><span>number-to-ipv6</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-plain-ip"><div class="inner"><span>plain-ip</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-plain-ip-str"><div class="inner"><span>plain-ip-str</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-preprocess-ip-list"><div class="inner"><span>preprocess-ip-list</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-string-to-address"><div class="inner"><span>string-to-address</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-to-address"><div class="inner"><span>to-address</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-to-str"><div class="inner"><span>to-str</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-to-str-plain"><div class="inner"><span>to-str-plain</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-to-str-v4"><div class="inner"><span>to-str-v4</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-to-str-v6"><div class="inner"><span>to-str-v6</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-to-string"><div class="inner"><span>to-string</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-to-string-v4"><div class="inner"><span>to-string-v4</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-to-string-v6"><div class="inner"><span>to-string-v6</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-to-v4"><div class="inner"><span>to-v4</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-to-v6"><div class="inner"><span>to-v6</span></div></a></li><li class="depth-1"><a href="io.randomseed.utils.ip.html#var-ubyte"><div class="inner"><span>ubyte</span></div></a></li></ul></div><div class="namespace-docs" id="content"><h1 class="anchor" id="top">io.randomseed.utils.ip</h1><h4 class="added">added in 1.0.0</h4><div class="doc"><div class="markdown"><p>Random utils, IP address support functions.</p>
</div></div><div class="public anchor" id="var-address"><h3>address</h3><div class="usage"><code>(address s)</code><code>(address a b c d)</code><code>(address a b c d e f g h i j k l m n o p)</code></div><div class="doc"><div class="markdown"><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.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L128">view source</a></div></div><div class="public anchor" id="var-bytes-to-address"><h3>bytes-to-address</h3><div class="usage"><code>(bytes-to-address b)</code><code>(bytes-to-address b & bytes)</code></div><div class="doc"><div class="markdown"><p>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.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L59">view source</a></div></div><div class="public anchor" id="var-bytes-to-ipv4"><h3>bytes-to-ipv4</h3><div class="usage"><code>(bytes-to-ipv4 b)</code><code>(bytes-to-ipv4 a b c d)</code></div><div class="doc"><div class="markdown"><p>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.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L35">view source</a></div></div><div class="public anchor" id="var-bytes-to-ipv6"><h3>bytes-to-ipv6</h3><div class="usage"><code>(bytes-to-ipv6 b)</code><code>(bytes-to-ipv6 a b c d e f g h i j k l m n o p)</code></div><div class="doc"><div class="markdown"><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.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L47">view source</a></div></div><div class="public anchor" id="var-in4t.3F"><h3>in4t?</h3><div class="usage"><code>(in4t? trie ip)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if an IPv6 address is contained within the given tree.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L230">view source</a></div></div><div class="public anchor" id="var-in6t.3F"><h3>in6t?</h3><div class="usage"><code>(in6t? trie ip)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if an IPv6 address is contained within the given tree.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L224">view source</a></div></div><div class="public anchor" id="var-inet-address.3F"><h3>inet-address?</h3><div class="usage"><code>(inet-address? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given value is of a type <code>java.net.InetAddress</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L19">view source</a></div></div><div class="public anchor" id="var-ip.3F"><h3>ip?</h3><div class="usage"><code>(ip? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given value (a string, a number, a sequence of bytes, or an IP address object) represents a valid IP address.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L214">view source</a></div></div><div class="public anchor" id="var-ipv4-mapped.3F"><h3>ipv4-mapped?</h3><div class="usage"><code>(ipv4-mapped? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> 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.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L201">view source</a></div></div><div class="public anchor" id="var-ipv4.3F"><h3>ipv4?</h3><div class="usage"><code>(ipv4? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given value (a string, a number, a sequence of bytes, or an IP address object) represents a valid IPv4 address.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L190">view source</a></div></div><div class="public anchor" id="var-ipv6.3F"><h3>ipv6?</h3><div class="usage"><code>(ipv6? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given value (a string, a number, a sequence of bytes, or an IP address object) represents a valid IPv6 address.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L179">view source</a></div></div><div class="public anchor" id="var-is-ip.3F"><h3>is-ip?</h3><div class="usage"><code>(is-ip? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given value is of type <code>inet.ipaddr.IPAddress</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L148">view source</a></div></div><div class="public anchor" id="var-is-ipv4-mapped.3F"><h3>is-ipv4-mapped?</h3><div class="usage"><code>(is-ipv4-mapped? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given value is of type <code>inet.ipaddr.ipv6.IPv6Address</code> and it is IPv4-mapped address.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L163">view source</a></div></div><div class="public anchor" id="var-is-ipv4.3F"><h3>is-ipv4?</h3><div class="usage"><code>(is-ipv4? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given value is of type <code>inet.ipaddr.ipv4.IPv4Address</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L153">view source</a></div></div><div class="public anchor" id="var-is-ipv6.3F"><h3>is-ipv6?</h3><div class="usage"><code>(is-ipv6? v)</code></div><div class="doc"><div class="markdown"><p>Returns <code>true</code> if the given value is of type <code>inet.ipaddr.ipv6.IPv6Address</code>.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L158">view source</a></div></div><div class="public anchor" id="var-java-inet-to-address"><h3>java-inet-to-address</h3><div class="usage"><code>(java-inet-to-address v)</code></div><div class="doc"><div class="markdown"><p>Converts <code>java.net.InetAddress</code> to IP address.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L102">view source</a></div></div><div class="public anchor" id="var-number-to-address"><h3>number-to-address</h3><div class="usage"><code>(number-to-address n)</code></div><div class="doc"><div class="markdown"><p>Coverts a number to an IP address. If the number is a kind of <code>java.math.BigInteger</code> or <code>clojure.lang.BigInt</code>, the IPv6 address will be created. Otherwise the number will be converted to <code>int</code> and IPv4 address will be created.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L92">view source</a></div></div><div class="public anchor" id="var-number-to-ipv4"><h3>number-to-ipv4</h3><div class="usage"><code>(number-to-ipv4 n)</code></div><div class="doc"><div class="markdown"><p>Coverts a number to an IPv4 address.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L82">view source</a></div></div><div class="public anchor" id="var-number-to-ipv6"><h3>number-to-ipv6</h3><div class="usage"><code>(number-to-ipv6 n)</code></div><div class="doc"><div class="markdown"><p>Coverts a number to an IPv6 address.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L87">view source</a></div></div><div class="public anchor" id="var-plain-ip"><h3>plain-ip</h3><div class="usage"><code>(plain-ip ip)</code></div><div class="doc"><div class="markdown"><p>Returns an IP address. If the address can be expressed as IPv4, it is returned as IPv4, otherwise as IPv6.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L260">view source</a></div></div><div class="public anchor" id="var-plain-ip-str"><h3>plain-ip-str</h3><div class="usage"><code>(plain-ip-str ip)</code></div><div class="doc"><div class="markdown"><p>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).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L268">view source</a></div></div><div class="public anchor" id="var-preprocess-ip-list"><h3>preprocess-ip-list</h3><div class="usage"><code>(preprocess-ip-list p)</code></div><div class="doc"><div class="markdown"><p>Takes a sequence of IP addresses and returns a vector of Trie trees with IP address ranges.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L282">view source</a></div></div><div class="public anchor" id="var-string-to-address"><h3>string-to-address</h3><div class="usage"><code>(string-to-address s)</code></div><div class="doc"><div class="markdown"><p>Coverts a string to an IP address.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L75">view source</a></div></div><div class="public anchor" id="var-to-address"><h3>to-address</h3><div class="usage"><code>(to-address s)</code><code>(to-address a b c d)</code><code>(to-address a b c d e f g h i j k l m n o p)</code></div><div class="doc"><div class="markdown"><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.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L110">view source</a></div></div><div class="public anchor" id="var-to-str"><h3>to-str</h3><div class="usage"><code>(to-str ip)</code></div><div class="doc"><div class="markdown"><p>Converts IP address to a string. Returns <code>nil</code> if it is not possible.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L138">view source</a></div></div><div class="public anchor" id="var-to-str-plain"><h3>to-str-plain</h3><div class="usage"><code>(to-str-plain ip)</code></div><div class="doc"><div class="markdown"><p>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).</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L275">view source</a></div></div><div class="public anchor" id="var-to-str-v4"><h3>to-str-v4</h3><div class="usage"><code>(to-str-v4 ip)</code></div><div class="doc"><div class="markdown"><p>Converts IP address to a string expressing IPv4 notation. Returns <code>nil</code> if this is not possible.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L248">view source</a></div></div><div class="public anchor" id="var-to-str-v6"><h3>to-str-v6</h3><div class="usage"><code>(to-str-v6 ip)</code></div><div class="doc"><div class="markdown"><p>Converts IP address to a string expressing IPv6 notation. Returns <code>nil</code> if this is not possible.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L236">view source</a></div></div><div class="public anchor" id="var-to-string"><h3>to-string</h3><div class="usage"><code>(to-string ip)</code></div><div class="doc"><div class="markdown"><p>Converts IP address to a string. Returns <code>nil</code> if it is not possible.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L143">view source</a></div></div><div class="public anchor" id="var-to-string-v4"><h3>to-string-v4</h3><div class="usage"><code>(to-string-v4 ip)</code></div><div class="doc"><div class="markdown"><p>Converts IP address to a string expressing IPv4 notation. Returns <code>nil</code> if this is not possible.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L254">view source</a></div></div><div class="public anchor" id="var-to-string-v6"><h3>to-string-v6</h3><div class="usage"><code>(to-string-v6 ip)</code></div><div class="doc"><div class="markdown"><p>Converts IP address to a string expressing IPv6 notation. Returns <code>nil</code> if this is not possible.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L242">view source</a></div></div><div class="public anchor" id="var-to-v4"><h3>to-v4</h3><div class="usage"><code>(to-v4 v)</code></div><div class="doc"><div class="markdown"><p>Converts the given IP address to IPv4. Returns <code>nil</code> if this is not possible.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L169">view source</a></div></div><div class="public anchor" id="var-to-v6"><h3>to-v6</h3><div class="usage"><code>(to-v6 v)</code></div><div class="doc"><div class="markdown"><p>Converts the given IP address to IPv6. Returns <code>nil</code> if this is not possible.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L174">view source</a></div></div><div class="public anchor" id="var-ubyte"><h3>ubyte</h3><div class="usage"><code>(ubyte v)</code></div><div class="doc"><div class="markdown"><p>Converts to an unchecked byte used to express unsigned values. Throws an <code>IllegalArgumentException</code> exception if the given value is not a byte but exceeds the range of 0-255.</p>
</div></div><div class="src-link"><a href="https://github.com/randomseed-io/utils/tree/1.2.34/src/io/randomseed/utils/ip.clj#L24">view source</a></div></div></div></body></html>