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

Azolo
Hey everyone, I just released WebSockex which is a Elixir WebSocket client. WebSockex strives to work as a OTP special process, be RFC6...
New
alisinabh
Hey everyone i’ve developed a library for Jalaali calendar for elixir which supports converting Gregorian dates to Jalaali and vice vers...
New
achempion
Hi, I would like to tell about my initiative to further maintain and develop Waffle project which is the fork of Arc library. The progre...
New
markmark206
simple_feature_flags is a tiny package that lets you turn features on or off based on which environment (e.g. localhost, staging, product...
New
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
mathieuprog
Hello :wave: Allow me to introduce you to Tz, an alternative time zone database support to Tzdata. Why another library? First and fore...
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
pkrawat1
Presenting Aviacommerce, open source e-commerce platform in Elixir Aviacommerce is an open source e-commerce platform in Elixir. We at...
New
bryanjos
Hi, I just published version 0.23.0 of Elixirscript. Most of the changes are around JavaScript interop now that Elixirscript uses the ...
New
mplatts
With HEEX released we decided to start a components library using Tailwind CSS - check it out here: Petal Components. We also have a boi...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
William
I would like to know that is there any online source for learning Phoenix Framework for building E-Commerce Store? Any advantage on build...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
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
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
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
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New

Sub Categories:

We're in Beta

About us Mission Statement