Documentation ¶
Overview ¶
Package deephash hashes a Go value recursively, in a predictable order, without looping. The hash is only valid within the lifetime of a program. Users should not store the hash on disk or send it over the network. The hash is sufficiently strong and unique such that Hash(&x) == Hash(&y) is an appropriate replacement for x == y.
The definition of equality is identical to reflect.DeepEqual except:
- Floating-point values are compared based on the raw bits, which means that NaNs (with the same bit pattern) are treated as equal.
- time.Time are compared based on whether they are the same instant in time and also in the same zone offset. Monotonic measurements and zone names are ignored as part of the hash.
- netip.Addr are compared based on a shallow comparison of the struct.
WARNING: This package, like most of the tailscale.com Go module, should be considered Tailscale-internal; we make no API promises.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasherForType ¶
HasherForType returns a hash that is specialized for the provided type.
Types ¶
Click to show internal directories.
Click to hide internal directories.