MCPcopy
hub / github.com/evilsocket/opensnitch / hexToInt2

Function hexToInt2

daemon/netstat/parse.go:46–64  ·  view source on GitHub ↗
(h string)

Source from the content-addressed store, hash-verified

44}
45
46func hexToInt2(h string) (uint, uint) {
47 if len(h) > 16 {
48 d, err := strconv.ParseUint(h[:16], 16, 64)
49 if err != nil {
50 log.Fatal("Error while parsing %s to int: %s", h[16:], err)
51 }
52 d2, err := strconv.ParseUint(h[16:], 16, 64)
53 if err != nil {
54 log.Fatal("Error while parsing %s to int: %s", h[16:], err)
55 }
56 return uint(d), uint(d2)
57 }
58
59 d, err := strconv.ParseUint(h, 16, 64)
60 if err != nil {
61 log.Fatal("Error while parsing %s to int: %s", h[16:], err)
62 }
63 return uint(d), 0
64}
65
66func hexToIP(h string) net.IP {
67 n, m := hexToInt2(h)

Callers 1

hexToIPFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected