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)
Most Liked
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
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
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.
Popular in Announcing
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









