xcrypto

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 16 Imported by: 0

README

xcrypto

Dependencies

  • github.com/Aoi-hosizora/ahlib
  • golang.org/x/crypto

Documents

Types
  • None
Variables
  • None
Constants
  • const BcryptMinCost int
  • const BcryptMaxCost int
  • const BcryptDefaultCost int
Functions
  • func FNV32(text string) uint32
  • func FNV32a(text string) uint32
  • func FNV64(text string) uint64
  • func FNV64a(text string) uint64
  • func CRC32(text string) uint32
  • func ADLER32(text string) uint32
  • func MD4(text string) string
  • func MD5(text string) string
  • func SHA1(text string) string
  • func SHA224(text string) string
  • func SHA256(text string) string
  • func SHA384(text string) string
  • func SHA512(text string) string
  • func SHA512_224(text string) string
  • func SHA512_256(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 Uint32Hasher(algorithm hash.Hash32, text string) uint32
  • func Uint64Hasher(algorithm hash.Hash64, text string) uint64
  • func StringHasher(algorithm hash.Hash, text string) string
  • func HexEncodeToBytes(data []byte) []byte
  • func HexEncodeToString(data []byte) string
  • func HexDecodeFromBytes(data []byte) ([]byte, error)
  • func HexDecodeFromString(data string) ([]byte, error)
  • func Base32EncodeToBytes(data []byte) []byte
  • func Base32EncodeToString(data []byte) string
  • func Base32DecodeFromBytes(data []byte) ([]byte, error)
  • func Base32DecodeFromString(data string) ([]byte, error)
  • func Base64EncodeToBytes(data []byte) []byte
  • func Base64EncodeToString(data []byte) string
  • func Base64DecodeFromBytes(data []byte) ([]byte, error)
  • func Base64DecodeFromString(data string) ([]byte, error)
  • func PKCS5Padding(data []byte, blockSize int) []byte
  • func PKCS5Trimming(data []byte) []byte
  • func BcryptEncrypt(password []byte, cost int) ([]byte, error)
  • func BcryptEncryptWithDefaultCost(password []byte) ([]byte, error)
  • func BcryptCompare(password, encrypted []byte) (ok bool, err error)
Methods
  • None

Documentation

Index

Constants

View Source
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 ADLER32 added in v1.5.0

func ADLER32(text string) uint32

ADLER32 uses adler32 to hash string to uint32.

func Base32DecodeFromBytes added in v1.5.0

func Base32DecodeFromBytes(data []byte) ([]byte, error)

Base32DecodeFromBytes decodes bytes from base32 bytes.

func Base32DecodeFromString added in v1.5.0

func Base32DecodeFromString(data string) ([]byte, error)

Base32DecodeFromString decodes bytes from base32 string.

func Base32EncodeToBytes added in v1.5.0

func Base32EncodeToBytes(data []byte) []byte

Base32EncodeToBytes encodes bytes to base32 bytes.

func Base32EncodeToString added in v1.5.0

func Base32EncodeToString(data []byte) string

Base32EncodeToString encodes bytes to base32 string.

func Base64DecodeFromBytes added in v1.5.0

func Base64DecodeFromBytes(data []byte) ([]byte, error)

Base64DecodeFromBytes decodes bytes from base64 bytes.

func Base64DecodeFromString added in v1.5.0

func Base64DecodeFromString(data string) ([]byte, error)

Base64DecodeFromString decodes bytes from base64 string.

func Base64EncodeToBytes added in v1.5.0

func Base64EncodeToBytes(data []byte) []byte

Base64EncodeToBytes encodes bytes to base64 bytes.

func Base64EncodeToString added in v1.5.0

func Base64EncodeToString(data []byte) string

Base64EncodeToString encodes bytes to base64 string.

func BcryptCompare added in v1.5.0

func BcryptCompare(password, encrypted []byte) (ok bool, err error)

BcryptCompare compares hashed encrypted password and given password.

func BcryptEncrypt added in v1.5.0

func BcryptEncrypt(password []byte, cost int) ([]byte, error)

BcryptEncrypt uses bcrypt to encrypt password using given cost.

func BcryptEncryptWithDefaultCost added in v1.5.0

func BcryptEncryptWithDefaultCost(password []byte) ([]byte, error)

BcryptEncryptWithDefaultCost uses bcrypt to encrypt password using BcryptDefaultCost.

func CRC32 added in v1.5.0

func CRC32(text string) uint32

CRC32 uses crc32 to hash string to uint32.

func FNV32

func FNV32(text string) uint32

FNV32 uses fnv32 to hash string to uint32.

func FNV32a

func FNV32a(text string) uint32

FNV32a uses fnv32a to hash string to uint32.

func FNV64

func FNV64(text string) uint64

FNV64 uses fnv64 to hash string to uint64.

func FNV64a

func FNV64a(text string) uint64

FNV64a uses fnv64a to hash string to uint64.

func HexDecodeFromBytes added in v1.5.0

func HexDecodeFromBytes(data []byte) ([]byte, error)

HexDecodeFromBytes decodes bytes from hex bytes.

func HexDecodeFromString added in v1.5.0

func HexDecodeFromString(data string) ([]byte, error)

HexDecodeFromString decodes bytes from hex string.

func HexEncodeToBytes added in v1.5.0

func HexEncodeToBytes(data []byte) []byte

HexEncodeToBytes encodes bytes to hex bytes.

func HexEncodeToString added in v1.5.0

func HexEncodeToString(data []byte) string

HexEncodeToString encodes bytes to hex string.

func MD4 added in v1.5.0

func MD4(text string) string

MD4 uses md4 to hash string.

func MD5

func MD5(text string) string

MD5 uses md5 to hash string.

func PKCS5Padding added in v1.5.0

func PKCS5Padding(data []byte, blockSize int) []byte

PKCS5Padding uses PKCS#5 and PKCS#7 to pad data to block aligned bytes.

func PKCS5Trimming added in v1.5.0

func PKCS5Trimming(data []byte) []byte

PKCS5Padding uses PKCS#5 and PKCS#7 to trim data from block aligned bytes.

func SHA1

func SHA1(text string) string

SHA1 uses sha-1 to hash string.

func SHA224 added in v1.5.0

func SHA224(text string) string

SHA224 uses sha2-224 to hash string.

func SHA256

func SHA256(text string) string

SHA256 uses sha2-256 to hash string.

func SHA384 added in v1.5.0

func SHA384(text string) string

SHA384 uses sha2-384 to hash string.

func SHA3_224 added in v1.5.0

func SHA3_224(text string) string

SHA3_224 uses sha3-224 to hash string.

func SHA3_256 added in v1.5.0

func SHA3_256(text string) string

SHA3_256 uses sha3-256 to hash string.

func SHA3_384 added in v1.5.0

func SHA3_384(text string) string

SHA3_384 uses sha3-384 to hash string.

func SHA3_512 added in v1.5.0

func SHA3_512(text string) string

SHA3_512 uses sha3-512 to hash string.

func SHA512

func SHA512(text string) string

SHA512 uses sha2-512 to hash string.

func SHA512_224 added in v1.5.0

func SHA512_224(text string) string

SHA512_224 uses sha2-512/224 to hash string.

func SHA512_256 added in v1.5.0

func SHA512_256(text string) string

SHA512_256 uses sha2-512/256 to hash string.

func StringHasher

func StringHasher(algorithm hash.Hash, text string) string

StringHasher uses hash.Hash to encode string to string.

func Uint32Hasher

func Uint32Hasher(algorithm hash.Hash32, text string) uint32

Uint32Hasher uses hash.Hash32 to encode string to uint32.

func Uint64Hasher

func Uint64Hasher(algorithm hash.Hash64, text string) uint64

Uint64Hasher uses hash.Hash64 to encode string to uint64.

Types

This section is empty.

Jump to

Keyboard shortcuts

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