Skip to content
Snippets Groups Projects
helper.go 213 B
Newer Older
  • Learn to ignore specific revisions
  • package net
    
    import "net"
    
    // IPv4ToUint32 converts an `net.IP` to an uint32 interpretation
    func IPv4ToUint32(ip net.IP) uint32 {
    
    Oliver Herms's avatar
    Oliver Herms committed
    	return uint32(ip[3]) + uint32(ip[2])<<8 + uint32(ip[1])<<16 + uint32(ip[0])<<24