brotherpowers / ipsubnet Goto Github PK
View Code? Open in Web Editor NEWNetwork calculator for subnet mask and other classless (CIDR) network information. ( GO )
License: MIT License
Network calculator for subnet mask and other classless (CIDR) network information. ( GO )
License: MIT License
/32 networks (single host) get weird output from some of the calls. Admittedly some of the function calls don't necessarily make sense for /32, but the output doesn't seem to be what one would expect:
sub := ipsubnet.SubnetCalculator("8.8.8.8", "32")
sub.GetNumberIPAddresses() // 0
sub.GetNumberAddressableHosts() // 1
sub.GetIPAddressRange()[0] // 8.8.8.8
sub.GetIPAddressRange()[1] // 263.263.263.263
sub.GetBroadcastAddress() // 263.263.263.263
GetNumberIPAddresses
: I would think this would return 1 since /32 generally means just a single IP address, though I can see how 0 might result from masking operations.GetNumberAddressableHosts
: I'm not sure if this should return 1 or 0, but 1 is probably preferred and is what is currently returnedGetIPAddressRange()[1]
: This should just return the single IP address. The return value isn't validGetBroadcastAddress()
: I would think this would just return the single IP address as well. The return value isn't valid.I encountered an issue when compiling a project with this library with the GOARCH=386
.
vendor/github.com/brotherpowers/ipsubnet/ip.go:16:27: constant 4294967295 overflows int
This is the line in question:
Line 16 in 30bc98f
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.