Documentation ¶
Overview ¶
Package hash contains utility functions for hashing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
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.
怎么判断某些分片是属于同一个数据报的呢? 这里对头部的一些特征值进行 hash 操作,所得结果当作这个数据报的 ID ,通过这个 ID,就可以找到已经到达的分片,并进行重组。 计算分片哈希值:用到的特征值为 ID、协议号、源地址、目的地址、一个随机数。
func IPv6FragmentHash ¶
func IPv6FragmentHash(h header.IPv6, f header.IPv6Fragment) uint32
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).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.