ityonemo

ityonemo

NetAddress: tools for IP and Mac addresses

I’ve been internally using a library for IP and Mac addresses, and thought I’d open source the toolset. Some of the more interesting features include

  • guard clauses is_ip, is_ipv4, is_ipv6
  • support for CIDR block notation and ease of generating ipv4 broadcast addresses
  • sigil_i for IP addresses, ranges, and support for matching pinned variables (useful for /24 addresses)

https://hexdocs.pm/net_address/IP.html

Most Liked

ityonemo

ityonemo

updated in 0.3.0 to have ranges and subnets work in each other’s Kernel.in/2 implementations; also implements is_in function to detect membership in ranges and subnets, in guards.

ityonemo

ityonemo

The standard library’s Map.from_struct/1 does not return an error tuple. But doing a more comprehensive look, I see that the datetime/time/naivedatetime modules have from_* functions which do emit error tuples. I guess network addresses seem more like datetimes than structs, so I’ll go ahead and make the from_ functions emit tuples and have the bang equivalents throw.

ityonemo

ityonemo

updated in 0.2.0 to have bang functions and tuple functions for from_* functions, and as a bonus I implemented random and IP.SockAddr module.

mbklein

mbklein

I like how you used the m modifier on sigil_i. Nice touch.

Where Next?

Popular in Libraries Top

hpopp
After just over two years in development, this latest version of Pigeon is what I finally consider done in regards to my original vision ...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
tfwright
After working on it for a couple of months and using it in production for most of that time, today I’ve released LiveAdmin, a LiveView ba...
New
Qqwy
Hello everyone, I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map...
New
mbuhot
EctoJob A transactional job queue built with Ecto, PostgreSQL and GenStage Available on Hex.pm: ecto_job | Hex Docs: API Reference — ec...
New
josevalim
Yes, yet another parser combinator library! Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
159 18262 141
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
tmbb
I’ve decided to create this topic to discuss optimization possibilities for something like Phoenix LiveView. I’ve created this topic unde...
New
Qqwy
While not as prevalent as in imperative languages, arrays (collections with efficient random element access) are still very useful in Eli...
New
maltoe
Hello! Came here to announce ChromicPDF, a pet project PDF generator I’ve been working on for the past few months. Why another PDF gener...
New

Other popular topics Top

pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Sub Categories:

We're in Beta

About us Mission Statement