Representation of IP addresses and subnets.
Go to file
Renovate Bot 12c229286d
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
chore(deps): update dependency ex_doc to v0.32.1
2024-04-13 08:28:05 +12:00
config chore: migrate to local. (#27) 2024-02-19 10:33:16 +13:00
lib chore: disable credo complains about is_ predicates. 2024-03-14 17:20:29 +13:00
test chore: migrate to local. (#27) 2024-02-19 10:33:16 +13:00
.drone.yml chore: fix docs release. 2024-03-14 19:23:24 +13:00
.formatter.exs Update deps 2018-09-04 03:25:04 +00:00
.gitignore Initial parsing of various formats for IP addresses. 2017-10-08 19:07:51 +13:00
.tool-versions chore(deps): update dependency erlang to v26.2.4 2024-04-13 00:29:15 +12:00
CHANGELOG.md chore: release version v2.0.3 2024-03-14 03:41:38 +00:00
LICENSE.md chore!: Relicense to HL3-FULL. 2023-01-17 11:00:21 +13:00
mix.exs chore(deps): update dependency ex_doc to ~> 0.32 2024-04-10 21:28:19 +12:00
mix.lock chore(deps): update dependency ex_doc to v0.32.1 2024-04-13 08:28:05 +12:00
README.md chore: release version v2.0.3 2024-03-14 03:41:38 +00:00
renovate.json chore: Configure Renovate (#25) 2024-02-14 17:43:20 +13:00

IP

Build Status Hex.pm Hippocratic License HL3-FULL

IP, IP, Ooray! Simple IP Address representations.

Installation

IP is available on Hex the package can be installed by adding ip to your list of dependencies in mix.exs:

def deps do
  [
    {:ip, "~> 2.0.3"}
  ]
end

Documentation

Documentation for the latest release is available on Hexdocs and for the main branch on docs.harton.nz.

Usage

ip provides representations for IP addresses and subnets for Elixir with a bunch of helpful stuff tacked on the side.

iex> ~i(192.0.2.1)
#IP.Address<192.0.2.1 DOCUMENTATION>

iex> ~i(2001:db8::)
#IP.Address<2001:db8:: DOCUMENTATION>

iex> outside = ~i(2001:db8::/64)
...> inside  = IP.Prefix.eui_64!(outside, "60:f8:1d:ad:d8:90")
...> IP.Prefix.contains_address?(outside, inside)
true

Github Mirror

This repository is mirrored on Github from it's primary location on my Forgejo instance. Feel free to raise issues and open PRs on Github.

License

This software is licensed under the terms of the HL3-FULL, see the LICENSE.md file included with this package for the terms.

This license actively proscribes this software being used by and for some industries, countries and activities. If your usage of this software doesn't comply with the terms of this license, then contact me with the details of your use-case to organise the purchase of a license - the cost of which may include a donation to a suitable charity or NGO.