MCPcopy Create free account
hub / github.com/SamNet-dev/snix / RankIPs

Function RankIPs

scanner/ip.go:81–90  ·  view source on GitHub ↗

RankIPs sorts reachable IPs by RTT ascending. Unreachable are dropped.

(in []IPResult)

Source from the content-addressed store, hash-verified

79
80// RankIPs sorts reachable IPs by RTT ascending. Unreachable are dropped.
81func RankIPs(in []IPResult) []IPResult {
82 out := make([]IPResult, 0, len(in))
83 for _, r := range in {
84 if r.Reachable {
85 out = append(out, r)
86 }
87 }
88 sort.Slice(out, func(i, j int) bool { return out[i].RTT < out[j].RTT })
89 return out
90}
91
92// RankSNIs keeps only OK outcomes and sorts by handshake time ascending.
93func RankSNIs(in []Result) []Result {

Callers 5

renderIPPanelMethod · 0.92
saveToProfileMethod · 0.92
newScanIPCmdFunction · 0.92
newScanAllCmdFunction · 0.92
runWizardFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected