Help us shape the future of Go! Take the 2026 Go Developer Survey

hashutil

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdditiveHash

func AdditiveHash(input string) uint32

AdditiveHash 加法 hash 算法。 AdditiveHash computes the additive hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func ApHash

func ApHash(input string) uint32

ApHash AP 算法。 ApHash computes the AP hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func Bernstein

func Bernstein(input string) uint32

Bernstein bernstein Bernstein's hash 算法。 Bernstein computes the Bernstein's hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func BkdrHash

func BkdrHash(input string) uint32

BkdrHash BKDR 算法。 BkdrHash computes the BKDR hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func DekHash

func DekHash(input string) uint32

DekHash DEK 算法。 DekHash computes the DEK hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func DjbHash

func DjbHash(input string) uint32

DjbHash DJB 算法。 DjbHash computes the DJB hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func ElfHash

func ElfHash(input string) uint32

ElfHash ELF 算法。 ElfHash computes the ELF hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func FnvHash

func FnvHash(input string) uint32

FnvHash 改进的32位 FNV 算法。 FnvHash computes the 32-bit FNV-1 hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func IntHash

func IntHash(key uint32) uint32

IntHash Thomas Wang 的算法,整数 hash。 IntHash computes the hash of an integer using Thomas Wang's algorithm. 参数 (param): key uint32 - 需要被哈希的整数。 参数 (param): key uint32 - the integer to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func JavaDefaultHash

func JavaDefaultHash(input string) int32

JavaDefaultHash JAVA 自带的 hash 算法。 JavaDefaultHash computes the default hash algorithm used in Java. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): int32 - 哈希值。 返回值 (return): int32 - the hash value.

func JsHash

func JsHash(input string) uint32

JsHash JS 算法。 jsHash computes the JS hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func MixHash

func MixHash(input string) uint64

MixHash 混合 hash 算法,输出 64 位的值。 MixHash computes a mixed hash of a given string, outputting a 64-bit value. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint64 - 哈希值。 返回值 (return): uint64 - the hash value.

func OneByOneHash

func OneByOneHash(input string) uint32

OneByOneHash 一次一个 hash 算法。 OneByOneHash computes the one-by-one hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func PjwHash

func PjwHash(input string) uint32

PjwHash PJW 算法。 PjwHash computes the PJW hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func RotatingHash

func RotatingHash(input string) uint32

RotatingHash 旋转 hash 算法。 RotatingHash computes the rotating hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func RsHash

func RsHash(input string) uint32

RsHash RS 算法 hash。 RsHash computes the RS hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func SdbmHash

func SdbmHash(input string) uint32

SdbmHash SDBM 算法。 SdbmHash computes the SDBM hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func TianlHash

func TianlHash(input string) uint32

TianlHash TianL Hash 算法。 TianlHash computes the TianL hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func Universal

func Universal(input string, prime uint32) uint32

Universal universal Universal Hashing 算法。 Universal computes the Universal Hashing hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

func Zobrist

func Zobrist(input string, table []uint32) uint32

Zobrist Hashing 算法。 Zobrist computes the Zobrist Hashing hash of a given string. 参数 (param): input string - 需要被哈希的字符串。 参数 (param): input string - the string to be hashed. 返回值 (return): uint32 - 哈希值。 返回值 (return): uint32 - the hash value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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