Skip to content
Snippets Groups Projects
Commit 95f9f987 authored by Oliver Herms's avatar Oliver Herms
Browse files

Fixing IPv4ToUint32

parent 70fef6df
No related branches found
No related tags found
No related merge requests found
......@@ -4,5 +4,5 @@ import "net"
// IPv4ToUint32 converts an `net.IP` to an uint32 interpretation
func IPv4ToUint32(ip net.IP) uint32 {
return uint32(ip[0]) + uint32(ip[1])<<8 + uint32(ip[2])<<16 + uint32(ip[3])<<24
return uint32(ip[3]) + uint32(ip[2])<<8 + uint32(ip[1])<<16 + uint32(ip[0])<<24
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment