key

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BLAKE2

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

Key is an object that stores the key data (in bytes), and also a pre-computed checksum of the key

func NewBLAKE2Key

func NewBLAKE2Key(keyBytes []byte) *BLAKE2

NewKey creates a new Key object with the given key data

func NewBLAKE2KeyStr

func NewBLAKE2KeyStr(key string) *BLAKE2

NewKeyStr creates a new Key object with the given key string data

func (*BLAKE2) Get

func (k *BLAKE2) Get() []byte

Get returns the hashed key data

func (*BLAKE2) String

func (k *BLAKE2) String() string

String returns the hashed key data as a string

type Key

type Key interface {
	Get() []byte
	String() string
}

func NewKey

func NewKey(key []byte) Key

NewKey creates a new Key object using the default hash algorithm

func NewKeyStr

func NewKeyStr(key string) Key

NewKeyStr creates a new Key object from a string using the default hash algorithm

type SHA256

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

Key is an object that stores the key data (in bytes), and also a pre-computed checksum of the key

func NewSHA256Key

func NewSHA256Key(keyBytes []byte) *SHA256

NewKey creates a new Key object with the given key data

func NewSHA256KeyStr

func NewSHA256KeyStr(key string) *SHA256

NewKeyStr creates a new Key object with the given key string data

func (*SHA256) Get

func (k *SHA256) Get() []byte

Get returns the hashed key data

func (*SHA256) String

func (k *SHA256) String() string

String returns the hashed key data as a string

Jump to

Keyboard shortcuts

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