net-ip
Utilities for working with IP addresses in Racket.
Documentation
The documentation is hosted on docs.racket-lang.org.
License
net-ip is licensed under the 3-Clause BSD license.
Utilities for working with IP addresses in Racket.
Utilities for working with IP addresses in Racket.
The documentation is hosted on docs.racket-lang.org.
net-ip is licensed under the 3-Clause BSD license.
I was pleasantly surprised to find this library when I needed it, so thanks!
I found myself needing to calculate IP ranges from cidr blocks.
I came up with the following:
#lang racket
;; LIBRARY
(require net/ip)
(define (network-last-address net)
(number->ipv4-address
(+ (sub1 (network-size net))
(ip-address->number (network-address net)))))
;; APPLICATION
(define (ip-range net)
(values (ip-address->string (network-address net))
(ip-address->string (network-last-address net))))
(ip-range (make-network "10.0.0.0/16"))
Which got me wondering if it makes sense to expose a network-last-address
function in this library.
bytes->ipv6-address claims to require 4 bytes as input, which seems to be a little short for an ipv6 address.
Both bytes->ipv*-address
functions claim that an execption is raised if the bytes are not in big-endian order. While the result might not match the expectation of the caller, an exception cannot be raised if the input bytes are not in big-endian order. How about
Unpack a byte array in big endian order into an IPv* address.
Must be exactly * bytes long, otherwise an exn:fail:contract? is raised.
replacing *
with the correct number, of course :-)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.