A library to lookup the ASN(Autonomous System Number) for an IP address. It uses the IPv6 to ASN database downloaded from https://iptoasn.com/. Supports ONLY IPv6 addresses for now.
go get github.com/libp2p/go-libp2p-asn-util
import (
asn "github.com/libp2p/go-libp2p-asn-util"
)
func main() {
store, err := asn.NewAsnStore()
asNumber,err := store.AsnForIP(net.ParseIP("2a03:2880:f003:c07:face:b00c::2"))
}
Feel free to join in. All welcome. Open an issue!
This repository falls under the IPFS Code of Conduct.
MIT