Versions in this module Expand all Collapse all v1 v1.0.1 Jun 30, 2026 v1.0.0 Jun 30, 2026 Changes in this version + const DefaultMaxFileSize + const MaxKParameter + const MinKParameter + var DeZigZagTable = f5core.DeZigZag[:] + var ErrCodeWordSizeMismatch = f5matrix.ErrCodeWordSizeMismatch + var ErrEmptyCodeWord = f5matrix.ErrEmptyCodeWord + var ErrInvalidExtractedMessageBase = errors.New("invalid extracted message") + var ErrInvalidKParameter = f5matrix.ErrInvalidKParameter + var ErrMessageBitsExceedK = f5matrix.ErrMessageBitsExceedK + var ErrPermutationMismatchBase = errors.New("permutation mismatch") + var ErrRecoveryFailedBase = errors.New("recovery failed") + var ErrShrinkageRecoveryFailedBase = errors.New("shrinkage recovery failed") + func ApplyDeZigZag(shuffled int) int + func ApplyHeaderXOR(headerBits int, random RandomSource) int + func CodeWordLength(k int) int + func ComputeCodeWordHash(codeWord []int) int + func DetectShrinkage(coefficient int16) bool + func DetectShrinkageCandidate(currentCoeff int16, expectedBit int) bool + func DetermineChangePosition(codeWord []int, messageBits, k int) (changePosition int, err error) + func ErrEmptyCoefficients() error + func ErrEmptyExtractedMessage() error + func ErrEmptyPassword() error + func ErrFileSizeZeroOrNegative(fileSize int) error + func ErrInsufficientCoefficientsHeader(bitsExtracted int) error + func ErrInsufficientCoefficientsMessage(bytesExtracted, expectedBytes int) error + func ErrInvalidExtractedMessage(detail string) error + func ErrInvalidFileSize(fileSize, maxFileSize int) error + func ErrInvalidK(k int) error + func ErrPermutationMismatch() error + func ErrRecoveryFailed(reason string) error + func ErrShrinkageRecoveryFailed(position int) error + func ExtractBit(coefficient int16) int + func ExtractFileSize(headerBits int) int + func ExtractHeaderBits(coefficients []int16, permutation []int) (headerBits, nextIndex int, err error) + func ExtractKParameter(headerBits int) int + func ExtractStegoBits(coefficients []int16) []int + func GetLogger() logger.Logger + func GetStegoBit(coefficient int16) int + func GetSupportedLocales() []string + func IsRecoveryError(err error) bool + func IsUsableCoefficient(shuffled, zigzag int, coefficient int16) bool + func IsUsableCoefficientSimple(index int, coefficient int16) bool + func NewF5PRNGFactory() f5prng.PRNGFactory + func NextSignedByte(random RandomSource) int + func RecoverCoefficients(stegoCoeffs []int16, password string, extractedMessage []byte, opts ...Option) ([]int16, error) + func RecoverCoefficientsInPlace(stegoCoeffs []int16, password string, extractedMessage []byte, opts ...Option) error + func RestoreShrunkCoefficient(expectedBit int) int16 + func ReverseModification(coefficient int16) int16 + func SetLogger(l logger.Logger) + func SetTranslator(translator TranslatorProvider) + func TryRecoverCoefficients(stegoCoeffs []int16, password string, extractedMessage []byte, opts ...Option) ([]int16, bool) + func TryRecoverCoefficientsInPlace(stegoCoeffs []int16, password string, extractedMessage []byte, opts ...Option) bool + func ValidateFileSize(fileSize, maxFileSize int) error + func ValidateKParameter(k int) error + func WrapError(err error, message string) error + type Config struct + Logger logger.Logger + MaxFileSize int + ShrinkageRecovery bool + StrictMode bool + func ApplyOptions(opts ...Option) *Config + func DefaultConfig() *Config + type DefaultRandomSourceFactory struct + func NewDefaultRandomSourceFactory() *DefaultRandomSourceFactory + func (f *DefaultRandomSourceFactory) New(hasher Hasher) RandomSource + type Hasher interface + Sum func(data []byte) []byte + type HeaderResult struct + FileSize int + K int + NextIndex int + func ExtractHeader(coefficients []int16, permutation []int, random RandomSource, maxFileSize int) (*HeaderResult, error) + type Option func(*Config) + func WithLogger(l logger.Logger) Option + func WithMaxFileSize(bytes int) Option + func WithShrinkageRecovery(enable bool) Option + func WithStrictMode(strict bool) Option + type PRNGFactory = f5prng.PRNGFactory + type Permutator interface + Generate func(size int, random RandomSource) ([]int, error) + GenerateInto func(buf []int, size int, random RandomSource) ([]int, error) + type RandomSource = f5prng.RandomSource + type RandomSourceFactory interface + New func(hasher Hasher) RandomSource + type Recoverer struct + func NewRecoverer(hasher Hasher, randomFactory RandomSourceFactory, permutator Permutator) *Recoverer + type TranslatorProvider interface + GetLocale func() string + HasKey func(key string) bool + SetLocale func(locale string) + Translate func(key string) string + TranslateWithArgs func(key string, args ...interface{}) string + func GetTranslator() TranslatorProvider + func NewTranslator(locale string) (TranslatorProvider, error)