package hash
import "gvisor.dev/gvisor/pkg/tcpip/network/hash"
Package hash contains utility functions for hashing.
Index ¶
- func Hash3Words(a, b, c, initval uint32) uint32
- func IPv4FragmentHash(h header.IPv4) uint32
- func IPv6FragmentHash(h header.IPv6, id uint32) uint32
- func RandN32(n int) []uint32
Functions ¶
func Hash3Words ¶
Hash3Words calculates the Jenkins hash of 3 32-bit words. This is adapted from linux.
func IPv4FragmentHash ¶
IPv4FragmentHash computes the hash of the IPv4 fragment as suggested in RFC 791.
func IPv6FragmentHash ¶
IPv6FragmentHash computes the hash of the ipv6 fragment. Unlike IPv4, the protocol is not used to compute the hash. RFC 2640 (sec 4.5) is not very sharp on this aspect. As a reference, also Linux ignores the protocol to compute the hash (inet6_hash_frag).
func RandN32 ¶
RandN32 generates a slice of n cryptographic random 32-bit numbers.
Source Files ¶
hash.go
- Version
- v0.0.0-20250515200445-d30c58e5b8a4 (latest)
- Published
- May 15, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 6 hours ago –
Tools for package owners.