Documentation
¶
Overview ¶
Package htlhash computes the htl (head, tail, length) hash of a file.
See https://opentelemetry.io/docs/specs/otel/profiles/mappings/#algorithm-for-processexecutablebuild_idhtlhash for more information.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hash ¶
type Hash [16]byte
Hash is the htl (head, tail, length) hash of a file.
func Compute ¶
func Compute(f io.ReadSeeker) (Hash, error)
Compute the hash of the first 4096 bytes of the file, the last 4096 bytes of the file, and the length of the file. This is a cheap to compute hash that is practically unique for the executable.
Note that the file's position will be left in an unknown state after this.
Derived from https://github.com/open-telemetry/opentelemetry-ebpf-profiler/blob/ec6ee459/libpf/fileid.go#L122-L128.