hash

package
v1.0.2002 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: Apache-2.0 Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MD5_16

func MD5_16(s string) string

MD5_16

Types

type Hash

type Hash struct {

	// 错误
	Error error
	// contains filtered or unexported fields
}

*

  • hash *
  • @create 2022-3-27
  • @author deatil

func FromBase64String

func FromBase64String(data string) Hash

FromBase64String

func FromBytes

func FromBytes(data []byte) Hash

字节

func FromHexString

func FromHexString(data string) Hash

FromHexString

func FromReader added in v1.0.2002

func FromReader(reader io.Reader) Hash

FromReader

func FromString

func FromString(data string) Hash

字符

func Hashing added in v1.0.2002

func Hashing() Hash

构造函数

func New added in v1.0.1003

func New() Hash

构造函数

func NewHash

func NewHash() Hash

构造函数

func (Hash) Adler32 added in v1.0.1005

func (this Hash) Adler32() Hash

Adler32

func (Hash) Base64Decode

func (this Hash) Base64Decode(s string) ([]byte, error)

Base64 解码

func (Hash) Base64Encode

func (this Hash) Base64Encode(src []byte) string

Base64 编码

func (Hash) Blake2b_256 added in v1.0.1003

func (this Hash) Blake2b_256() Hash

Blake2b_256 哈希值

func (Hash) Blake2b_384 added in v1.0.1003

func (this Hash) Blake2b_384() Hash

Blake2b_384 哈希值

func (Hash) Blake2b_512 added in v1.0.1003

func (this Hash) Blake2b_512() Hash

Blake2b_512 哈希值

func (Hash) Blake2s_128 added in v1.0.2002

func (this Hash) Blake2s_128() Hash

Blake2s_128 哈希值

func (Hash) Blake2s_256 added in v1.0.1003

func (this Hash) Blake2s_256() Hash

Blake2s_256 哈希值

func (Hash) BlockSize added in v1.0.2002

func (this Hash) BlockSize() int

BlockSize

func (Hash) CRC16_Modbus added in v1.0.1003

func (this Hash) CRC16_Modbus() Hash

CRC16_Modbus 哈希值 data := ToString()

func (Hash) CRC16_X25 added in v1.0.1003

func (this Hash) CRC16_X25() Hash

CRC16_X25 哈希值 data := ToString()

func (Hash) CRC32_Castagnoli added in v1.0.2002

func (this Hash) CRC32_Castagnoli() Hash

CRC32Castagnoli 哈希值

func (Hash) CRC32_IEEE added in v1.0.2002

func (this Hash) CRC32_IEEE() Hash

CRC32IEEE 哈希值

func (Hash) CRC32_Koopman added in v1.0.2002

func (this Hash) CRC32_Koopman() Hash

CRC32Koopman 哈希值

func (Hash) CRC64_ECMA added in v1.0.2002

func (this Hash) CRC64_ECMA() Hash

CRC64ECMA 哈希值

func (Hash) CRC64_ISO added in v1.0.2002

func (this Hash) CRC64_ISO() Hash

CRC64ISO

func (Hash) CShake128 added in v1.0.2002

func (this Hash) CShake128(N, S []byte, num int) Hash

CShake128 哈希值 num = 64

func (Hash) CShake256 added in v1.0.2002

func (this Hash) CShake256(N, S []byte, num int) Hash

CShake256 哈希值 num = 64

func (Hash) Checksum added in v1.0.2002

func (this Hash) Checksum(h hash.Hash) Hash

CheckSum

func (Hash) Fnv128 added in v1.0.1005

func (this Hash) Fnv128() Hash

Fnv128

func (Hash) Fnv128a added in v1.0.1005

func (this Hash) Fnv128a() Hash

Fnv128a

func (Hash) Fnv32 added in v1.0.1005

func (this Hash) Fnv32() Hash

Fnv32

func (Hash) Fnv32a added in v1.0.1005

func (this Hash) Fnv32a() Hash

Fnv32a

func (Hash) Fnv64 added in v1.0.1005

func (this Hash) Fnv64() Hash

Fnv64

func (Hash) Fnv64a added in v1.0.1005

func (this Hash) Fnv64a() Hash

Fnv64a

func (Hash) FromBase64String

func (this Hash) FromBase64String(data string) Hash

FromBase64String

func (Hash) FromBytes

func (this Hash) FromBytes(data []byte) Hash

字节

func (Hash) FromHexString

func (this Hash) FromHexString(data string) Hash

FromHexString

func (Hash) FromReader added in v1.0.2002

func (this Hash) FromReader(reader io.Reader) Hash

FromReader

func (Hash) FromString

func (this Hash) FromString(data string) Hash

字符

func (Hash) FuncHash

func (this Hash) FuncHash(f func([]byte) ([]byte, error)) Hash

自定义方法

func (Hash) Hash added in v1.0.2002

func (this Hash) Hash() hash.Hash

Hash

func (Hash) HexDecode

func (this Hash) HexDecode(s string) ([]byte, error)

Hex 解码

func (Hash) HexEncode

func (this Hash) HexEncode(src []byte) string

Hex 编码

func (Hash) HmacAdler32 added in v1.0.2002

func (this Hash) HmacAdler32(secret []byte) Hash

HmacAdler32 哈希值

func (Hash) HmacMd2 added in v1.0.2002

func (this Hash) HmacMd2(secret []byte) Hash

HmacMd2 哈希值

func (Hash) HmacMd4

func (this Hash) HmacMd4(secret []byte) Hash

HmacMd4 哈希值

func (Hash) HmacMd5

func (this Hash) HmacMd5(secret []byte) Hash

HmacMd5 哈希值

func (Hash) HmacRipemd160

func (this Hash) HmacRipemd160(secret []byte) Hash

HmacRipemd160 哈希值

func (Hash) HmacSHA1

func (this Hash) HmacSHA1(secret []byte) Hash

HmacSHA1 哈希值

func (Hash) HmacSHA3_224 added in v1.0.2002

func (this Hash) HmacSHA3_224(secret []byte) Hash

HmacSHA3_224 哈希值

func (Hash) HmacSHA3_256 added in v1.0.2002

func (this Hash) HmacSHA3_256(secret []byte) Hash

HmacSHA3_256 哈希值

func (Hash) HmacSHA3_384 added in v1.0.2002

func (this Hash) HmacSHA3_384(secret []byte) Hash

HmacSHA3_384 哈希值

func (Hash) HmacSHA3_512 added in v1.0.2002

func (this Hash) HmacSHA3_512(secret []byte) Hash

HmacSHA3_512 哈希值

func (Hash) HmacSha224

func (this Hash) HmacSha224(secret []byte) Hash

HmacSha224 哈希值

func (Hash) HmacSha256

func (this Hash) HmacSha256(secret []byte) Hash

HmacSha256 哈希值

func (Hash) HmacSha384

func (this Hash) HmacSha384(secret []byte) Hash

HmacSha384 哈希值

func (Hash) HmacSha512

func (this Hash) HmacSha512(secret []byte) Hash

HmacSha512 哈希值

func (Hash) HmacSha512_224 added in v1.0.2002

func (this Hash) HmacSha512_224(secret []byte) Hash

HmacSha512_224 哈希值

func (Hash) HmacSha512_256 added in v1.0.2002

func (this Hash) HmacSha512_256(secret []byte) Hash

HmacSha512_256 哈希值

func (Hash) Keccak256

func (this Hash) Keccak256() Hash

Keccak256 哈希值

func (Hash) Keccak512

func (this Hash) Keccak512() Hash

Keccak512 哈希值

func (Hash) MD2

func (this Hash) MD2() Hash

md2 签名

func (Hash) MD4

func (this Hash) MD4() Hash

MD4 哈希值

func (Hash) MD5

func (this Hash) MD5() Hash

MD5

func (Hash) MD5SHA1

func (this Hash) MD5SHA1() Hash

MD5SHA1 哈希值

func (Hash) Maphash added in v1.0.1005

func (this Hash) Maphash() Hash

Maphash

func (Hash) Murmur128 added in v1.0.2002

func (this Hash) Murmur128() Hash

murmur128

func (Hash) Murmur128WithSeed added in v1.0.2002

func (this Hash) Murmur128WithSeed(seed uint32) Hash

murmur128

func (Hash) Murmur32 added in v1.0.2002

func (this Hash) Murmur32() Hash

murmur32

func (Hash) Murmur32WithSeed added in v1.0.2002

func (this Hash) Murmur32WithSeed(seed uint32) Hash

murmur32

func (Hash) Murmur64 added in v1.0.2002

func (this Hash) Murmur64() Hash

murmur64

func (Hash) Murmur64WithSeed added in v1.0.2002

func (this Hash) Murmur64WithSeed(seed uint32) Hash

murmur64

func (Hash) NewAdler32 added in v1.0.2002

func (this Hash) NewAdler32() Hash

NewAdler32

func (Hash) NewBlake2b_256 added in v1.0.2002

func (this Hash) NewBlake2b_256(key []byte) Hash

NewBlake2b_256

func (Hash) NewBlake2b_384 added in v1.0.2002

func (this Hash) NewBlake2b_384(key []byte) Hash

NewBlake2b_384

func (Hash) NewBlake2b_512 added in v1.0.2002

func (this Hash) NewBlake2b_512(key []byte) Hash

NewBlake2b_512

func (Hash) NewBlake2s_128 added in v1.0.2002

func (this Hash) NewBlake2s_128(key []byte) Hash

NewBlake2s_128

func (Hash) NewBlake2s_256 added in v1.0.2002

func (this Hash) NewBlake2s_256(key []byte) Hash

NewBlake2s_256

func (Hash) NewCRC32_Castagnoli added in v1.0.2002

func (this Hash) NewCRC32_Castagnoli() Hash

NewCRC32_Castagnoli

func (Hash) NewCRC32_IEEE added in v1.0.2002

func (this Hash) NewCRC32_IEEE() Hash

NewCRC32_IEEE

func (Hash) NewCRC32_Koopman added in v1.0.2002

func (this Hash) NewCRC32_Koopman() Hash

NewCRC32_Koopman

func (Hash) NewCRC64_ECMA added in v1.0.2002

func (this Hash) NewCRC64_ECMA() Hash

NewCRC64_ECMA

func (Hash) NewCRC64_ISO added in v1.0.2002

func (this Hash) NewCRC64_ISO() Hash

NewCRC64_ISO

func (Hash) NewFnv128 added in v1.0.2002

func (this Hash) NewFnv128() Hash

NewFnv128

func (Hash) NewFnv128a added in v1.0.2002

func (this Hash) NewFnv128a() Hash

NewFnv128a

func (Hash) NewFnv32 added in v1.0.2002

func (this Hash) NewFnv32() Hash

NewFnv32

func (Hash) NewFnv32a added in v1.0.2002

func (this Hash) NewFnv32a() Hash

NewFnv32a

func (Hash) NewFnv64 added in v1.0.2002

func (this Hash) NewFnv64() Hash

NewFnv64

func (Hash) NewFnv64a added in v1.0.2002

func (this Hash) NewFnv64a() Hash

NewFnv64a

func (Hash) NewHash added in v1.0.2002

func (this Hash) NewHash(h hash.Hash) Hash

NewHash

func (Hash) NewHmac added in v1.0.2002

func (this Hash) NewHmac(h func() hash.Hash, secret []byte) Hash

NewHmac HMAC (Hash-based Message Authentication Code) 常用于接口签名验证 支持的算法有: md5、sha1、sha256、sha512、adler32、crc32、crc32b、crc32c、 fnv132、fnv164、fnv1a32、fnv1a64、 gost、gost-crypto、haval128,3、haval128,4、haval128,5、 haval160,3、haval160,4、haval160,5、haval192,3、haval192,4、 haval192,5、haval224,3、haval224,4、haval224,5、haval256,3、 haval256,4、haval256,5、joaat、md2、md4、 ripemd128、ripemd160、ripemd256、ripemd320、 sha224、sha3-224、sha3-256、sha3-384、sha3-512、 sha384、sha512/224、sha512/256、 snefru、snefru256、tiger128,3、tiger128,4、tiger160,3、 tiger160,4、tiger192,3、tiger192,4、whirlpool

func (Hash) NewHmacAdler32 added in v1.0.2002

func (this Hash) NewHmacAdler32(secret []byte) Hash

NewHmacAdler32

func (Hash) NewHmacMd2 added in v1.0.2002

func (this Hash) NewHmacMd2(secret []byte) Hash

NewHmacMd2

func (Hash) NewHmacMd4 added in v1.0.2002

func (this Hash) NewHmacMd4(secret []byte) Hash

NewHmacMd4

func (Hash) NewHmacMd5 added in v1.0.2002

func (this Hash) NewHmacMd5(secret []byte) Hash

NewHmacMd5

func (Hash) NewHmacRipemd160 added in v1.0.2002

func (this Hash) NewHmacRipemd160(secret []byte) Hash

NewHmacRipemd160

func (Hash) NewHmacSHA1 added in v1.0.2002

func (this Hash) NewHmacSHA1(secret []byte) Hash

NewHmacSHA1

func (Hash) NewHmacSHA3_224 added in v1.0.2002

func (this Hash) NewHmacSHA3_224(secret []byte) Hash

NewHmacSHA3_224

func (Hash) NewHmacSHA3_256 added in v1.0.2002

func (this Hash) NewHmacSHA3_256(secret []byte) Hash

NewHmacSHA3_256

func (Hash) NewHmacSHA3_384 added in v1.0.2002

func (this Hash) NewHmacSHA3_384(secret []byte) Hash

NewHmacSHA3_384

func (Hash) NewHmacSHA3_512 added in v1.0.2002

func (this Hash) NewHmacSHA3_512(secret []byte) Hash

NewHmacSHA3_512

func (Hash) NewHmacSha224 added in v1.0.2002

func (this Hash) NewHmacSha224(secret []byte) Hash

NewHmacSha224

func (Hash) NewHmacSha256 added in v1.0.2002

func (this Hash) NewHmacSha256(secret []byte) Hash

NewHmacSha256

func (Hash) NewHmacSha384 added in v1.0.2002

func (this Hash) NewHmacSha384(secret []byte) Hash

NewHmacSha384

func (Hash) NewHmacSha512 added in v1.0.2002

func (this Hash) NewHmacSha512(secret []byte) Hash

NewHmacSha512

func (Hash) NewHmacSha512_224 added in v1.0.2002

func (this Hash) NewHmacSha512_224(secret []byte) Hash

NewHmacSha512_224

func (Hash) NewHmacSha512_256 added in v1.0.2002

func (this Hash) NewHmacSha512_256(secret []byte) Hash

NewHmacSha512_256

func (Hash) NewKeccak256 added in v1.0.2002

func (this Hash) NewKeccak256() Hash

NewKeccak256

func (Hash) NewKeccak512 added in v1.0.2002

func (this Hash) NewKeccak512() Hash

NewKeccak512

func (Hash) NewMD2 added in v1.0.2002

func (this Hash) NewMD2() Hash

NewMD2

func (Hash) NewMD4 added in v1.0.2002

func (this Hash) NewMD4() Hash

NewMD4

func (Hash) NewMD5 added in v1.0.2002

func (this Hash) NewMD5() Hash

NewMD5

func (Hash) NewMaphash added in v1.0.2002

func (this Hash) NewMaphash() Hash

NewMaphash

func (Hash) NewMurmur128 added in v1.0.2002

func (this Hash) NewMurmur128() Hash

NewMurmur128

func (Hash) NewMurmur128WithSeed added in v1.0.2002

func (this Hash) NewMurmur128WithSeed(seed uint32) Hash

NewMurmur128WithSeed

func (Hash) NewMurmur32 added in v1.0.2002

func (this Hash) NewMurmur32() Hash

NewMurmur32

func (Hash) NewMurmur32WithSeed added in v1.0.2002

func (this Hash) NewMurmur32WithSeed(seed uint32) Hash

NewMurmur32WithSeed

func (Hash) NewMurmur64 added in v1.0.2002

func (this Hash) NewMurmur64() Hash

NewMurmur64

func (Hash) NewMurmur64WithSeed added in v1.0.2002

func (this Hash) NewMurmur64WithSeed(seed uint32) Hash

NewMurmur64WithSeed

func (Hash) NewRipemd160 added in v1.0.2002

func (this Hash) NewRipemd160() Hash

NewRipemd160

func (Hash) NewSHA1 added in v1.0.2002

func (this Hash) NewSHA1() Hash

NewSHA1

func (Hash) NewSHA224 added in v1.0.2002

func (this Hash) NewSHA224() Hash

NewSHA224

func (Hash) NewSHA256 added in v1.0.2002

func (this Hash) NewSHA256() Hash

NewSHA256

func (Hash) NewSHA384 added in v1.0.2002

func (this Hash) NewSHA384() Hash

NewSHA384

func (Hash) NewSHA3_224 added in v1.0.2002

func (this Hash) NewSHA3_224() Hash

NewSHA3_224

func (Hash) NewSHA3_256 added in v1.0.2002

func (this Hash) NewSHA3_256() Hash

NewSHA3_256

func (Hash) NewSHA3_384 added in v1.0.2002

func (this Hash) NewSHA3_384() Hash

NewSHA3_384

func (Hash) NewSHA3_512 added in v1.0.2002

func (this Hash) NewSHA3_512() Hash

NewSHA3_512

func (Hash) NewSHA512 added in v1.0.2002

func (this Hash) NewSHA512() Hash

NewSHA512

func (Hash) NewSHA512_224 added in v1.0.2002

func (this Hash) NewSHA512_224() Hash

NewSHA512_224

func (Hash) NewSHA512_256 added in v1.0.2002

func (this Hash) NewSHA512_256() Hash

NewSHA512_256

func (Hash) NewSM3 added in v1.0.2002

func (this Hash) NewSM3() Hash

NewSM3

func (Hash) Reset added in v1.0.2002

func (this Hash) Reset() Hash

Reset

func (Hash) Ripemd160

func (this Hash) Ripemd160() Hash

Ripemd160 哈希值

func (Hash) SHA1

func (this Hash) SHA1() Hash

SHA1 哈希值

func (Hash) SHA224

func (this Hash) SHA224() Hash

SHA224 哈希值

func (Hash) SHA256

func (this Hash) SHA256() Hash

SHA256 哈希值

func (Hash) SHA384

func (this Hash) SHA384() Hash

SHA384 哈希值

func (Hash) SHA3_224

func (this Hash) SHA3_224() Hash

SHA3_224 哈希值

func (Hash) SHA3_256

func (this Hash) SHA3_256() Hash

SHA3_256 哈希值

func (Hash) SHA3_384

func (this Hash) SHA3_384() Hash

SHA3_384 哈希值

func (Hash) SHA3_512

func (this Hash) SHA3_512() Hash

SHA3_512 哈希值

func (Hash) SHA512

func (this Hash) SHA512() Hash

SHA512 哈希值

func (Hash) SHA512_224

func (this Hash) SHA512_224() Hash

SHA512_224 哈希值

func (Hash) SHA512_256

func (this Hash) SHA512_256() Hash

SHA512_256 哈希值

func (Hash) SM3 added in v1.0.1002

func (this Hash) SM3() Hash

国密 sm3 签名

func (Hash) Shake128

func (this Hash) Shake128(num int) Hash

Shake128 哈希值 num = 64

func (Hash) Shake256

func (this Hash) Shake256(num int) Hash

Shake256 哈希值 num = 64

func (Hash) Size added in v1.0.2002

func (this Hash) Size() int

Size

func (Hash) String

func (this Hash) String() string

输出字符

func (Hash) Sum added in v1.0.2002

func (this Hash) Sum(in []byte) Hash

Sum

func (Hash) Sum32 added in v1.0.2002

func (this Hash) Sum32() uint32

Sum32

func (Hash) Sum64 added in v1.0.2002

func (this Hash) Sum64() uint64

Sum64

func (Hash) ToBase64String

func (this Hash) ToBase64String() string

输出Base64

func (Hash) ToBytes

func (this Hash) ToBytes() []byte

输出字节

func (Hash) ToHexString

func (this Hash) ToHexString() string

输出Hex

func (Hash) ToReader added in v1.0.2002

func (this Hash) ToReader() io.Reader

输出 io.Reader

func (Hash) ToString

func (this Hash) ToString() string

输出字符

func (Hash) Write added in v1.0.2002

func (this Hash) Write(p []byte) Hash

Write

func (Hash) WriteString added in v1.0.2002

func (this Hash) WriteString(s string) Hash

WriteString

Jump to

Keyboard shortcuts

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