htlhash

package
v0.0.0-...-e5c38ee Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

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.

func (Hash) String

func (h Hash) String() string

String returns the hex-encoded hash.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL