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 + var ErrInvalidBound = Error + var ErrNilHasher = Error + var ErrSeedHashFailed = Error + var ErrStateUpdateFailed = Error + func GetLogger() logger.Logger + func GetSupportedLocales() []string + func NextIntN(rs RandomSource, n int) (int, error) + func SetLogger(l logger.Logger) + func SetTranslator(translator TranslatorProvider) + type DefaultFactory struct + func (f *DefaultFactory) NewPRNG() RandomSource + type Error struct + Code ErrorCode + Message string + func (e Error) Error() string + type ErrorCode int + const ErrCodeInvalidBound + const ErrCodeNilHasher + const ErrCodeSeedHashFailed + const ErrCodeStateUpdateFailed + type Hasher interface + BlockSize func() int + Reset func() + Size func() int + Sum func(data []byte) ([]byte, error) + func NewDefaultHasher() Hasher + func NewSHA1Hasher() Hasher + type HasherWithSumInto interface + SumInto func(dst []byte, data []byte) error + type PRNGFactory interface + NewPRNG func() RandomSource + func NewDefaultFactory() PRNGFactory + type RandomSource interface + Clear func() + NextBytes func(n int) []byte + NextInt func() int32 + Seed func(seed []byte) error + func NewSecureRandom(hasher Hasher) RandomSource + type RandomSourceWithBytesInto interface + NextBytesInto func(dst []byte) error + type SHA1Hasher struct + func (h *SHA1Hasher) BlockSize() int + func (h *SHA1Hasher) Reset() + func (h *SHA1Hasher) Size() int + func (h *SHA1Hasher) Sum(data []byte) ([]byte, error) + func (h *SHA1Hasher) SumInto(dst, data []byte) error + type SecureRandom struct + func (sr *SecureRandom) Clear() + func (sr *SecureRandom) LastError() error + func (sr *SecureRandom) NextBytes(n int) []byte + func (sr *SecureRandom) NextBytesInto(dst []byte) error + func (sr *SecureRandom) NextInt() int32 + func (sr *SecureRandom) Seed(seed []byte) error + 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)