hash

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package hash contains utility functions for hashing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash3Words

func Hash3Words(a, b, c, initval uint32) uint32

Hash3Words calculates the Jenkins hash of 3 32-bit words. This is adapted from linux.

func IPv4FragmentHash

func IPv4FragmentHash(h header.IPv4) uint32

IPv4FragmentHash computes the hash of the IPv4 fragment as suggested in RFC 791.

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).

func RandN32

func RandN32(n int) []uint32

RandN32 generates a slice of n cryptographic random 32-bit numbers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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