hashers

package
v1.88.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrHashMismatch = errors.New("hash mismatch")
View Source
var SHA512HexPattern = regexp.MustCompile(`^[0-9a-f]{128}$`)

SHA512HexPattern matches a SHA-512 digest as 128 lowercase hex characters, the form Doorkeeper stores (Digest::SHA512.hexdigest). A Doorkeeper plaintext is 64 hex chars (SecureRandom.hex(32)), so an accidentally-sent plaintext fails the match instead of being stored as a digest.

Functions

This section is empty.

Types

type SHA512

type SHA512 struct{}

func (*SHA512) Compare

func (h *SHA512) Compare(ctx context.Context, hash, data []byte) error

func (*SHA512) Hash

func (h *SHA512) Hash(_ context.Context, data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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