interfaces

package
v0.3.23 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package interfaces implements the functions, types, and interfaces for the module.

Package interfaces implements the functions, types, and interfaces for the module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgorithmResolver added in v0.3.18

type AlgorithmResolver func(algType types.Type) (types.Type, error)

func (AlgorithmResolver) ResolveType added in v0.3.18

func (r AlgorithmResolver) ResolveType(algType types.Type) (types.Type, error)

type Codec

type Codec interface {
	Encoder
	Decoder
	Version
}

Codec defines the interface for hash encoding and decoding operations

type ConfigValidator

type ConfigValidator interface {
	// Validate validates the configuration
	Validate(*types.Config) error
}

ConfigValidator defines the interface for configuration validation

type Cryptographic

type Cryptographic interface {
	Type() types.Type
	// Hash generates a hash for the given password
	Hash(password string) (*types.HashParts, error)
	// HashWithSalt generates a hash for the given password with the specified salt
	HashWithSalt(password string, salt []byte) (*types.HashParts, error)
	// Verify checks if the given hashed password matches the plaintext password
	Verify(parts *types.HashParts, oldPassword string) error
}

Cryptographic defines the interface for cryptographic operations

type Decoder

type Decoder interface {
	// Decode decodes a string into hash parts
	Decode(encoded string) (*types.HashParts, error)
}

Decoder defines the interface for hash decoding operations

type Encoder

type Encoder interface {
	// Encode encodes salt and hash into a string
	Encode(parts *types.HashParts) (string, error)
}

Encoder defines the interface for hash encoding operations

type Params added in v0.3.18

type Params interface {
	ConfigValidator
	// String returns the string representation of parameters
	String() string

	// ToMap converts parameters to map[string]string format for encoding.
	ToMap() map[string]string

	// FromMap parses parameters from map[string]string format.
	FromMap(params map[string]string) error
}

Params A common interface for algorithm parameters is defined

type TypeResolver added in v0.3.18

type TypeResolver interface {
	ResolveType(algType types.Type) (types.Type, error)
}

type Version added in v0.3.18

type Version interface {
	// Version returns the version of the codec
	Version() string
}

Version defines the interface for version operations

Jump to

Keyboard shortcuts

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