Documentation ¶
Index ¶
- Variables
- func LeftCRCPadding(text string, size int) string
- func MD5_16(s string) string
- func RegisterHmacHash(h HmacHash, f func() hash.Hash)
- type DataName
- type DataSet
- func (this *DataSet[N, M]) Add(name N, data func() M) *DataSet[N, M]
- func (this *DataSet[N, M]) All() map[N]func() M
- func (this *DataSet[N, M]) Clean()
- func (this *DataSet[N, M]) Get(name N) func() M
- func (this *DataSet[N, M]) Has(name N) bool
- func (this *DataSet[N, M]) Len() int
- func (this *DataSet[N, M]) Names() []N
- func (this *DataSet[N, M]) Remove(name N) *DataSet[N, M]
- type Hash
- func (this Hash) Adler32() Hash
- func (this Hash) Base64Decode(s string) ([]byte, error)
- func (this Hash) Base64Encode(src []byte) string
- func (this Hash) Blake224() Hash
- func (this Hash) Blake256() Hash
- func (this Hash) Blake2b_256() Hash
- func (this Hash) Blake2b_384() Hash
- func (this Hash) Blake2b_512() Hash
- func (this Hash) Blake2s_128() Hash
- func (this Hash) Blake2s_256() Hash
- func (this Hash) Blake384() Hash
- func (this Hash) Blake512() Hash
- func (this Hash) BlockSize() int
- func (this Hash) CRC16_Modbus() Hash
- func (this Hash) CRC16_X25() Hash
- func (this Hash) CRC32_Castagnoli() Hash
- func (this Hash) CRC32_IEEE() Hash
- func (this Hash) CRC32_Koopman() Hash
- func (this Hash) CRC64_ECMA() Hash
- func (this Hash) CRC64_ISO() Hash
- func (this Hash) CShake128(N, S []byte, num int) Hash
- func (this Hash) CShake256(N, S []byte, num int) Hash
- func (this Hash) Checksum(h hash.Hash) Hash
- func (this Hash) Echo224() Hash
- func (this Hash) Echo256() Hash
- func (this Hash) Echo384() Hash
- func (this Hash) Echo512() Hash
- func (this Hash) Fnv128() Hash
- func (this Hash) Fnv128a() Hash
- func (this Hash) Fnv32() Hash
- func (this Hash) Fnv32a() Hash
- func (this Hash) Fnv64() Hash
- func (this Hash) Fnv64a() Hash
- func (this Hash) FromBase64String(data string) Hash
- func (this Hash) FromBytes(data []byte) Hash
- func (this Hash) FromHexString(data string) Hash
- func (this Hash) FromReader(reader io.Reader) Hash
- func (this Hash) FromString(data string) Hash
- func (this Hash) FuncHash(f func([]byte) ([]byte, error)) Hash
- func (this Hash) GetError() error
- func (this Hash) Gost34112012(size int) Hash
- func (this Hash) Gost34112012256() Hash
- func (this Hash) Gost34112012512() Hash
- func (this Hash) Gost341194(cipher func([]byte) cipher.Block) Hash
- func (this Hash) HAS160() Hash
- func (this Hash) Hash() hash.Hash
- func (this Hash) HexDecode(s string) ([]byte, error)
- func (this Hash) HexEncode(src []byte) string
- func (this Hash) Hmac(h func() hash.Hash, secret []byte) Hash
- func (this Hash) JH() Hash
- func (this Hash) Keccak256() Hash
- func (this Hash) Keccak512() Hash
- func (this Hash) LSH256() Hash
- func (this Hash) LSH256_224() Hash
- func (this Hash) LSH512() Hash
- func (this Hash) LSH512_224() Hash
- func (this Hash) LSH512_256() Hash
- func (this Hash) LSH512_384() Hash
- func (this Hash) MD2() Hash
- func (this Hash) MD4() Hash
- func (this Hash) MD5() Hash
- func (this Hash) MD5SHA1() Hash
- func (this Hash) Maphash() Hash
- func (this Hash) Murmur128() Hash
- func (this Hash) Murmur128WithSeed(seed uint32) Hash
- func (this Hash) Murmur32() Hash
- func (this Hash) Murmur32WithSeed(seed uint32) Hash
- func (this Hash) Murmur64() Hash
- func (this Hash) Murmur64WithSeed(seed uint32) Hash
- func (this Hash) NewAdler32() Hash
- func (this Hash) NewBlake224() Hash
- func (this Hash) NewBlake256() Hash
- func (this Hash) NewBlake2b_256(key []byte) Hash
- func (this Hash) NewBlake2b_384(key []byte) Hash
- func (this Hash) NewBlake2b_512(key []byte) Hash
- func (this Hash) NewBlake2s_128(key []byte) Hash
- func (this Hash) NewBlake2s_256(key []byte) Hash
- func (this Hash) NewBlake384() Hash
- func (this Hash) NewBlake512() Hash
- func (this Hash) NewBy(name Mode, cfg ...any) Hash
- func (this Hash) NewCRC32_Castagnoli() Hash
- func (this Hash) NewCRC32_IEEE() Hash
- func (this Hash) NewCRC32_Koopman() Hash
- func (this Hash) NewCRC64_ECMA() Hash
- func (this Hash) NewCRC64_ISO() Hash
- func (this Hash) NewCShake128(N, S []byte) Hash
- func (this Hash) NewCShake256(N, S []byte) Hash
- func (this Hash) NewEcho224() Hash
- func (this Hash) NewEcho256() Hash
- func (this Hash) NewEcho384() Hash
- func (this Hash) NewEcho512() Hash
- func (this Hash) NewFnv128() Hash
- func (this Hash) NewFnv128a() Hash
- func (this Hash) NewFnv32() Hash
- func (this Hash) NewFnv32a() Hash
- func (this Hash) NewFnv64() Hash
- func (this Hash) NewFnv64a() Hash
- func (this Hash) NewGost34112012(size int) Hash
- func (this Hash) NewGost34112012256() Hash
- func (this Hash) NewGost34112012512() Hash
- func (this Hash) NewGost341194(cipher func([]byte) cipher.Block) Hash
- func (this Hash) NewHAS160() Hash
- func (this Hash) NewHash(h hash.Hash) Hash
- func (this Hash) NewHmac(h func() hash.Hash, secret []byte) Hash
- func (this Hash) NewJH() Hash
- func (this Hash) NewKeccak256() Hash
- func (this Hash) NewKeccak512() Hash
- func (this Hash) NewLSH256() Hash
- func (this Hash) NewLSH256_224() Hash
- func (this Hash) NewLSH512() Hash
- func (this Hash) NewLSH512_224() Hash
- func (this Hash) NewLSH512_256() Hash
- func (this Hash) NewLSH512_384() Hash
- func (this Hash) NewMD2() Hash
- func (this Hash) NewMD4() Hash
- func (this Hash) NewMD5() Hash
- func (this Hash) NewMaphash() Hash
- func (this Hash) NewMurmur128() Hash
- func (this Hash) NewMurmur128WithSeed(seed uint32) Hash
- func (this Hash) NewMurmur32() Hash
- func (this Hash) NewMurmur32WithSeed(seed uint32) Hash
- func (this Hash) NewMurmur64() Hash
- func (this Hash) NewMurmur64WithSeed(seed uint32) Hash
- func (this Hash) NewRabin(polynomial uint64, window int) Hash
- func (this Hash) NewRipemd160() Hash
- func (this Hash) NewSHA1() Hash
- func (this Hash) NewSHA224() Hash
- func (this Hash) NewSHA256() Hash
- func (this Hash) NewSHA384() Hash
- func (this Hash) NewSHA3_224() Hash
- func (this Hash) NewSHA3_256() Hash
- func (this Hash) NewSHA3_384() Hash
- func (this Hash) NewSHA3_512() Hash
- func (this Hash) NewSHA512() Hash
- func (this Hash) NewSHA512_224() Hash
- func (this Hash) NewSHA512_256() Hash
- func (this Hash) NewSM3() Hash
- func (this Hash) NewShake128() Hash
- func (this Hash) NewShake256() Hash
- func (this Hash) NewSiphash128(k []byte) Hash
- func (this Hash) NewSiphash64(k []byte) Hash
- func (this Hash) NewSiphashWithCDroundsAndHashSize(k []byte, crounds, drounds int32, hashSize int) Hash
- func (this Hash) NewTiger() Hash
- func (this Hash) NewTiger2() Hash
- func (this Hash) NewWhirlpool() Hash
- func (this Hash) NewXxhash32() Hash
- func (this Hash) NewXxhash64() Hash
- func (this Hash) Rabin(polynomial uint64, window int) Hash
- func (this Hash) Reset() Hash
- func (this Hash) Ripemd160() Hash
- func (this Hash) SHA1() Hash
- func (this Hash) SHA224() Hash
- func (this Hash) SHA256() Hash
- func (this Hash) SHA384() Hash
- func (this Hash) SHA3_224() Hash
- func (this Hash) SHA3_256() Hash
- func (this Hash) SHA3_384() Hash
- func (this Hash) SHA3_512() Hash
- func (this Hash) SHA512() Hash
- func (this Hash) SHA512_224() Hash
- func (this Hash) SHA512_256() Hash
- func (this Hash) SM3() Hash
- func (this Hash) Shake128(num int) Hash
- func (this Hash) Shake256(num int) Hash
- func (this Hash) Siphash128(k []byte) Hash
- func (this Hash) Siphash64(k []byte) Hash
- func (this Hash) SiphashWithCDroundsAndHashSize(k []byte, crounds, drounds int32, hashSize int) Hash
- func (this Hash) Size() int
- func (this Hash) String() string
- func (this Hash) Sum(in []byte) Hash
- func (this Hash) Sum32() uint32
- func (this Hash) Sum64() uint64
- func (this Hash) SumBy(name Mode, cfg ...any) Hash
- func (this Hash) Tiger() Hash
- func (this Hash) Tiger2() Hash
- func (this Hash) ToBase64String() string
- func (this Hash) ToBytes() []byte
- func (this Hash) ToHexString() string
- func (this Hash) ToReader() io.Reader
- func (this Hash) ToString() string
- func (this Hash) Whirlpool() Hash
- func (this Hash) Write(p []byte) Hash
- func (this Hash) WriteReader(reader io.Reader) Hash
- func (this Hash) WriteString(s string) Hash
- func (this Hash) Xxhash32() Hash
- func (this Hash) Xxhash64() Hash
- type HmacHash
- type IHash
- type Mode
- type TypeName
- type TypeSet
Constants ¶
This section is empty.
Variables ¶
var TypeMode = NewTypeSet[Mode, string](maxMode)
Type Mode
var UseHash = NewDataSet[Mode, IHash]()
使用
Functions ¶
func LeftCRCPadding ¶ added in v1.0.2005
CRC 左侧补码 0
func RegisterHmacHash ¶ added in v1.0.2003
Types ¶
type DataSet ¶ added in v1.0.2005
*
- 数据设置 *
- @create 2023-3-31
- @author deatil
type Hash ¶
type Hash struct { // 错误 Error error // contains filtered or unexported fields }
*
- hash *
- @create 2022-3-27
- @author deatil
func (Hash) CRC32_Castagnoli ¶ added in v1.0.2002
CRC32Castagnoli 哈希值
func (Hash) CRC32_Koopman ¶ added in v1.0.2002
CRC32Koopman 哈希值
func (Hash) FromReader ¶ added in v1.0.2002
FromReader
func (Hash) Gost34112012 ¶ added in v1.0.2008
gost34112012 签名
func (Hash) Gost34112012256 ¶ added in v1.0.2008
gost34112012256 签名
func (Hash) Gost34112012512 ¶ added in v1.0.2008
gost34112012512 签名
func (Hash) Gost341194 ¶ added in v1.0.2008
gost341194 签名
func (Hash) Hmac ¶ added in v1.0.2003
Hmac 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) Murmur128WithSeed ¶ added in v1.0.2002
murmur128
func (Hash) Murmur32WithSeed ¶ added in v1.0.2002
murmur32
func (Hash) Murmur64WithSeed ¶ added in v1.0.2002
murmur64
func (Hash) NewBlake2b_256 ¶ added in v1.0.2002
NewBlake2b_256
func (Hash) NewBlake2b_384 ¶ added in v1.0.2002
NewBlake2b_384
func (Hash) NewBlake2b_512 ¶ added in v1.0.2002
NewBlake2b_512
func (Hash) NewBlake2s_128 ¶ added in v1.0.2002
NewBlake2s_128
func (Hash) NewBlake2s_256 ¶ added in v1.0.2002
NewBlake2s_256
func (Hash) NewCRC32_Castagnoli ¶ added in v1.0.2002
NewCRC32_Castagnoli
func (Hash) NewCRC32_Koopman ¶ added in v1.0.2002
NewCRC32_Koopman
func (Hash) NewCShake128 ¶ added in v1.0.2010
NewCShake128
func (Hash) NewCShake256 ¶ added in v1.0.2010
NewCShake256
func (Hash) NewGost34112012 ¶ added in v1.0.2008
NewGost34112012
func (Hash) NewGost34112012256 ¶ added in v1.0.2008
NewGost34112012256
func (Hash) NewGost34112012512 ¶ added in v1.0.2008
NewGost34112012512
func (Hash) NewGost341194 ¶ added in v1.0.2008
NewGost341194
func (Hash) NewMurmur128WithSeed ¶ added in v1.0.2002
NewMurmur128WithSeed
func (Hash) NewMurmur32WithSeed ¶ added in v1.0.2002
NewMurmur32WithSeed
func (Hash) NewMurmur64WithSeed ¶ added in v1.0.2002
NewMurmur64WithSeed
func (Hash) NewSiphash128 ¶ added in v1.0.2009
NewSiphash128
func (Hash) NewSiphash64 ¶ added in v1.0.2009
NewSiphash64
func (Hash) NewSiphashWithCDroundsAndHashSize ¶ added in v1.0.2008
func (this Hash) NewSiphashWithCDroundsAndHashSize(k []byte, crounds, drounds int32, hashSize int) Hash
NewSiphashWithCDroundsAndHashSize
func (Hash) SiphashWithCDroundsAndHashSize ¶ added in v1.0.2008
func (this Hash) SiphashWithCDroundsAndHashSize(k []byte, crounds, drounds int32, hashSize int) Hash
SiphashWithCDroundsAndHashSize
func (Hash) WriteReader ¶ added in v1.0.2007
WriteReader
func (Hash) WriteString ¶ added in v1.0.2002
WriteString
type IHash ¶ added in v1.0.2005
type IHash interface { // Sum [输入内容, 其他配置] Sum(data []byte, cfg ...any) ([]byte, error) // New New(cfg ...any) (hash.Hash, error) }
接口
Source Files ¶
- adler32.go
- blake.go
- blake256.go
- blake512.go
- crc16.go
- crc32.go
- crc64.go
- echo.go
- fnv.go
- gost.go
- has160.go
- hash.go
- hash_data_set.go
- hash_from.go
- hash_helper.go
- hash_sum.go
- hash_to.go
- hash_type_set.go
- hash_use.go
- hmac.go
- jh.go
- keccak.go
- lsh256.go
- lsh512.go
- maphash.go
- md2.go
- md4.go
- md5.go
- md5sha1.go
- murmur3.go
- rabin.go
- ripemd160.go
- sha.go
- sha3.go
- shake.go
- siphash.go
- sm3.go
- tiger.go
- whirlpool.go
- xxhash.go