codec

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeParams

func DecodeParams(params string) (map[string]string, error)

func EncodeParams

func EncodeParams(params map[string]string) string

EncodeParams encodes a map of parameters into a string. It sorts the keys to ensure a consistent output string.

func NewCodec

func NewCodec(opts ...Option) interfaces.Codec

NewCodec creates a new codec

Types

type Codec

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

Codec implements a generic hash codec

func (*Codec) Decode

func (c *Codec) Decode(encoded string) (*types.HashParts, error)

Decode implements the core decoding method

func (*Codec) Encode

func (c *Codec) Encode(parts *types.HashParts) (string, error)

Encode implements the core encoding method

func (*Codec) Version

func (c *Codec) Version() string

type Option

type Option func(*Codec)

Option defines configuration options for the codec

func WithVersion

func WithVersion(version string) Option

WithVersion sets the version number

Jump to

Keyboard shortcuts

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