Documentation ¶
Index ¶
- Constants
- func ADLER32(text string) uint32
- func Base32DecodeFromBytes(data []byte) ([]byte, error)
- func Base32DecodeFromString(data string) ([]byte, error)
- func Base32EncodeToBytes(data []byte) []byte
- func Base32EncodeToString(data []byte) string
- func Base64DecodeFromBytes(data []byte) ([]byte, error)
- func Base64DecodeFromString(data string) ([]byte, error)
- func Base64EncodeToBytes(data []byte) []byte
- func Base64EncodeToString(data []byte) string
- func BcryptCompare(password, encrypted []byte) (ok bool, err error)
- func BcryptEncrypt(password []byte, cost int) ([]byte, error)
- func BcryptEncryptWithDefaultCost(password []byte) ([]byte, error)
- func CRC32(text string) uint32
- func FNV32(text string) uint32
- func FNV32a(text string) uint32
- func FNV64(text string) uint64
- func FNV64a(text string) uint64
- func HexDecodeFromBytes(data []byte) ([]byte, error)
- func HexDecodeFromString(data string) ([]byte, error)
- func HexEncodeToBytes(data []byte) []byte
- func HexEncodeToString(data []byte) string
- func MD4(text string) string
- func MD5(text string) string
- func PKCS5Padding(data []byte, blockSize int) []byte
- func PKCS5Trimming(data []byte) []byte
- func SHA1(text string) string
- func SHA224(text string) string
- func SHA256(text string) string
- func SHA384(text string) string
- func SHA3_224(text string) string
- func SHA3_256(text string) string
- func SHA3_384(text string) string
- func SHA3_512(text string) string
- func SHA512(text string) string
- func SHA512_224(text string) string
- func SHA512_256(text string) string
- func StringHasher(algorithm hash.Hash, text string) string
- func Uint32Hasher(algorithm hash.Hash32, text string) uint32
- func Uint64Hasher(algorithm hash.Hash64, text string) uint64
Constants ¶
const ( BcryptMinCost int = 4 // The bcrypt minimum allowable cost. BcryptMaxCost int = 31 // The bcrypt maximum allowable cost. BcryptDefaultCost int = 10 // The bcrypt default cost, and this will actually be set if a cost is below BcryptMinCost. )
Variables ¶
This section is empty.
Functions ¶
func Base32DecodeFromBytes ¶ added in v1.5.0
Base32DecodeFromBytes decodes bytes from base32 bytes.
func Base32DecodeFromString ¶ added in v1.5.0
Base32DecodeFromString decodes bytes from base32 string.
func Base32EncodeToBytes ¶ added in v1.5.0
Base32EncodeToBytes encodes bytes to base32 bytes.
func Base32EncodeToString ¶ added in v1.5.0
Base32EncodeToString encodes bytes to base32 string.
func Base64DecodeFromBytes ¶ added in v1.5.0
Base64DecodeFromBytes decodes bytes from base64 bytes.
func Base64DecodeFromString ¶ added in v1.5.0
Base64DecodeFromString decodes bytes from base64 string.
func Base64EncodeToBytes ¶ added in v1.5.0
Base64EncodeToBytes encodes bytes to base64 bytes.
func Base64EncodeToString ¶ added in v1.5.0
Base64EncodeToString encodes bytes to base64 string.
func BcryptCompare ¶ added in v1.5.0
BcryptCompare compares hashed encrypted password and given password.
func BcryptEncrypt ¶ added in v1.5.0
BcryptEncrypt uses bcrypt to encrypt password using given cost.
func BcryptEncryptWithDefaultCost ¶ added in v1.5.0
BcryptEncryptWithDefaultCost uses bcrypt to encrypt password using BcryptDefaultCost.
func HexDecodeFromBytes ¶ added in v1.5.0
HexDecodeFromBytes decodes bytes from hex bytes.
func HexDecodeFromString ¶ added in v1.5.0
HexDecodeFromString decodes bytes from hex string.
func HexEncodeToBytes ¶ added in v1.5.0
HexEncodeToBytes encodes bytes to hex bytes.
func HexEncodeToString ¶ added in v1.5.0
HexEncodeToString encodes bytes to hex string.
func PKCS5Padding ¶ added in v1.5.0
PKCS5Padding uses PKCS#5 and PKCS#7 to pad data to block aligned bytes.
func PKCS5Trimming ¶ added in v1.5.0
PKCS5Padding uses PKCS#5 and PKCS#7 to trim data from block aligned bytes.
func SHA512_224 ¶ added in v1.5.0
SHA512_224 uses sha2-512/224 to hash string.
func SHA512_256 ¶ added in v1.5.0
SHA512_256 uses sha2-512/256 to hash string.
func StringHasher ¶
StringHasher uses hash.Hash to encode string to string.
func Uint32Hasher ¶
Uint32Hasher uses hash.Hash32 to encode string to uint32.
Types ¶
This section is empty.