crypto

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blake2b256

func Blake2b256(v []byte) []byte

Blake2b256 returns blake2b 256 bytes hash of v

func Decrypt

func Decrypt(ciphertext []byte, key []byte) ([]byte, error)

Decrypt decrypts a ciphertext

func Encrypt

func Encrypt(plaintext []byte, key []byte) ([]byte, error)

Encrypt encrypts a plaintext

func Hash20

func Hash20(v []byte) []byte

Hash20 returns 20 bytes hash derived from truncating sha512 output of v

func Hash20Hex

func Hash20Hex(v []byte) string

Hash20Hex is like Hash20 but returns hex output

func IsValidPushAddr

func IsValidPushAddr(id string) bool

IsValidPushAddr checks whether the given id is a valid bech32 encoded address

func MakeNamespaceHash

func MakeNamespaceHash(ns string) string

MakeNamespaceHash creates a hash of a namespace name

func MustDecodePushKeyID

func MustDecodePushKeyID(id string) []byte

MustDecodePushKeyID decodes a push key ID Panics if decoding fails.

func RIPEMD160

func RIPEMD160(v []byte) []byte

RIPEMD160 returns RIPEMD160 (20 bytes) hash of v

Types

This section is empty.

Jump to

Keyboard shortcuts

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