散列 | hash

散列包

  • import "hash"

  • 概述

  • 索引

  • 子目录

概述

散列(Hash)包提供 散列函数的接口。

索引

  • type Hash

  • type Hash32

  • type Hash64

包文件

hash.go

type Hash(查看源代码)

Hash 是所有哈希函数实现的通用接口。

type Hash interface { // Write(通过嵌入式 io.Writer 接口)向运行的哈希添加更多数据。 // 它永远不会返回错误。 io.Writer // Sum 将当前哈希附加到 b 并返回结果切片。 // 它不会更改底层哈希状态。 Sum(b []byte) []byte // 重置将哈希重置为其初始状态。 Reset() // Size 返回 Sum 将返回的字节数。 Size() int // BlockSize 返回哈希的底层块大小。 // Write方法必须能够接受任何数量 // 的数据,但如果所有写入,它可以更有效地运行 // 是块大小的倍数。 BlockSize() int }

type Hash32(查看源代码)

Hash32是所有32位散列函数实现的通用接口。

type Hash32 interface { Hash Sum32() uint32 }

type Hash64(查看源代码)

Hash64 是所有 64 位散列函数实现的通用接口。

type Hash64 interface { Hash Sum64() uint64 }

子目录

名称概要
adler32软件包adler32实现Adler-32校验和。
crc32Package crc32实现32位循环冗余校验或CRC-32校验和。
crc64Package crc64实现64位循环冗余校验或CRC-64校验和。
fnvPackage fnv实现了由Glenn Fowler,Landon Curt Noll和Phong Vo创建的FNV-1和FNV-1a,非加密散列函数。