crypto

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crypto

type Crypto struct{}

func New added in v0.18.0

func New() *Crypto

func (Crypto) CreateHMAC added in v0.17.0

func (c Crypto) CreateHMAC(ctx context.Context, algorithm string, key interface{}) *Hasher

CreateHMAC returns a new HMAC hash using the given algorithm and key.

func (*Crypto) CreateHash

func (*Crypto) CreateHash(ctx context.Context, algorithm string) *Hasher

CreateHash returns a Hasher instance that uses the given algorithm.

func (Crypto) HexEncode added in v0.24.0

func (c Crypto) HexEncode(ctx context.Context, data interface{}) string

HexEncode returns a string with the hex representation of the provided byte array or ArrayBuffer.

func (*Crypto) Hmac added in v0.17.0

func (c *Crypto) Hmac(
	ctx context.Context, algorithm string, key, input interface{}, outputEncoding string,
) interface{}

Hmac returns a new HMAC hash of input using the given algorithm and key in the given encoding.

func (*Crypto) Md4

func (c *Crypto) Md4(ctx context.Context, input interface{}, outputEncoding string) interface{}

Md4 returns the MD4 hash of input in the given encoding.

func (*Crypto) Md5

func (c *Crypto) Md5(ctx context.Context, input interface{}, outputEncoding string) interface{}

Md5 returns the MD5 hash of input in the given encoding.

func (*Crypto) RandomBytes added in v0.24.0

func (*Crypto) RandomBytes(ctx context.Context, size int) []byte

RandomBytes returns random data of the given size.

func (*Crypto) Ripemd160

func (c *Crypto) Ripemd160(ctx context.Context, input interface{}, outputEncoding string) interface{}

Ripemd160 returns the RIPEMD160 hash of input in the given encoding.

func (*Crypto) Sha1

func (c *Crypto) Sha1(ctx context.Context, input interface{}, outputEncoding string) interface{}

Sha1 returns the SHA1 hash of input in the given encoding.

func (*Crypto) Sha256

func (c *Crypto) Sha256(ctx context.Context, input interface{}, outputEncoding string) interface{}

Sha256 returns the SHA256 hash of input in the given encoding.

func (*Crypto) Sha384

func (c *Crypto) Sha384(ctx context.Context, input interface{}, outputEncoding string) interface{}

Sha384 returns the SHA384 hash of input in the given encoding.

func (*Crypto) Sha512

func (c *Crypto) Sha512(ctx context.Context, input interface{}, outputEncoding string) interface{}

Sha512 returns the SHA512 hash of input in the given encoding.

func (*Crypto) Sha512_224

func (c *Crypto) Sha512_224(ctx context.Context, input interface{}, outputEncoding string) interface{}

Sha512_224 returns the SHA512/224 hash of input in the given encoding.

func (*Crypto) Sha512_256

func (c *Crypto) Sha512_256(ctx context.Context, input interface{}, outputEncoding string) interface{}

Sha512_256 returns the SHA512/256 hash of input in the given encoding.

type Hasher

type Hasher struct {
	// contains filtered or unexported fields
}

func (*Hasher) Digest

func (hasher *Hasher) Digest(outputEncoding string) interface{}

Digest returns the hash value in the given encoding.

func (*Hasher) Update

func (hasher *Hasher) Update(input interface{})

Update the hash with the input data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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