hmac

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MinKeySize = 16

MinKeySize минимальная длина ключа

Variables

View Source
var (
	// ErrInvalidKeySize ошибка, возникающая при создании Hasher с коротким ключом
	ErrInvalidKeySize = errors.New("invalid key size")
)

Functions

This section is empty.

Types

type Hasher

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

Hasher hmac реализация интерфейса hasher.Hasher

func New

func New(key string) (*Hasher, error)

New возвращает новый hmac Hasher

func (*Hasher) Hash

func (h *Hasher) Hash(data string) (string, error)

Hash вычисляет хэш переданной строки

func (*Hasher) IsValid

func (h *Hasher) IsValid(data, hash string) (bool, error)

IsValid проверяет хэш переданной строки

Jump to

Keyboard shortcuts

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