Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/ ipconv Public

Golang IP address converter (provides conversion between net.IP and integer).

License

Notifications You must be signed in to change notification settings

praserx/ipconv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

23 Commits

Repository files navigation

ipconv

This library provides simple conversion between net.IP and integer (net.IP <--> int). As new feature, library now contains extension of net.ParseIP which returns also byte length of IP address on input.

I hope it will serve you well.

Example

package main
import (
 "fmt"
 "net"
 "github.com/praserx/ipconv"
)
func main() {
 if ip, version, err := ipconv.ParseIP("192.168.1.1"); err != nil && version == 4 {
 fmt.Println(ipconv.IPv4ToInt(ip))
 }
}

About

Golang IP address converter (provides conversion between net.IP and integer).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

Languages

AltStyle によって変換されたページ (->オリジナル) /