Both traceroute-caller and etl implement the same logic to compute IDs for hops in traceroute and hopannotation1 data.
The code in etl should be cross-referenced from traceroute-caller.
https://github.com/m-lab/etl/blob/6b71af189cc7da413cce59f798ca3b3377832c8c/parser/parser.go#L87