sha

package
v0.0.0-...-381c4e2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ByteSize      = 32
	ShaNullString = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
	Null          = ShaNullString
)

Variables

View Source
var Equaler equaler
View Source
var ErrIsNull = errors.New("sha is null")
View Source
var Lessor lessor
View Source
var Resetter resetter

Functions

func GetPool

func GetPool() schnittstellen.Pool[Sha, *Sha]

func MakeErrIsNull

func MakeErrIsNull(s *Sha) error

func MakeHashWriter

func MakeHashWriter() (h hash.Hash)

func MakeReadCloser

func MakeReadCloser(r io.Reader) (src readCloser)

func MakeReadCloserTee

func MakeReadCloserTee(r io.Reader, w io.Writer) (src readCloser)

func MakeWriter

func MakeWriter(in io.Writer) (out *writer)

func NopAkteFactory

func NopAkteFactory() schnittstellen.AkteIOFactory

func PageIndexForSha

func PageIndexForSha(width uint8, s schnittstellen.ShaLike) (n uint8, err error)

func PageIndexForString

func PageIndexForString(width uint8, s string) (n uint8, err error)

Types

type Bytes

type Bytes [ByteSize]byte

type PageId

type PageId struct {
	Index  uint8
	Dir    string
	Prefix string
}

func PageIdFromPath

func PageIdFromPath(n uint8, p string) PageId

func (*PageId) Path

func (pid *PageId) Path() string

func (PageId) String

func (pid PageId) String() string

type PathComponents

type PathComponents interface {
	PathComponents() []string
}

type ReadCloser

type ReadCloser = schnittstellen.ShaReadCloser

TODO-P4 remove

func MakeNopReadCloser

func MakeNopReadCloser(rc io.ReadCloser) ReadCloser

type Sha

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

func FromFormatString

func FromFormatString(f string, vs ...interface{}) *Sha

func FromHash

func FromHash(h hash.Hash) (s *Sha)

func FromString

func FromString(s string) *Sha

func FromStringer

func FromStringer(v schnittstellen.Stringer) *Sha

func Make

func Make(s schnittstellen.ShaLike) *Sha

func MakeSha

func MakeSha(v string) (s *Sha, err error)

func MakeShaFromPath

func MakeShaFromPath(p string) (s *Sha, err error)

func Must

func Must(v string) (s *Sha)

func (*Sha) Equals

func (a *Sha) Equals(b *Sha) bool

func (*Sha) EqualsAny

func (a *Sha) EqualsAny(b any) bool

func (*Sha) EqualsSha

func (a *Sha) EqualsSha(b schnittstellen.ShaLike) bool

func (*Sha) GetBytes

func (s *Sha) GetBytes() Bytes

func (*Sha) GetShaBytes

func (s *Sha) GetShaBytes() []byte

func (*Sha) GetShaLike

func (s *Sha) GetShaLike() schnittstellen.ShaLike

func (*Sha) GetShaString

func (s *Sha) GetShaString() string

func (*Sha) IsNull

func (s *Sha) IsNull() bool

func (*Sha) Kopf

func (s *Sha) Kopf() string

func (*Sha) MarshalBinary

func (s *Sha) MarshalBinary() (text []byte, err error)

func (*Sha) MarshalText

func (s *Sha) MarshalText() (text []byte, err error)

func (*Sha) Path

func (s *Sha) Path(pc ...string) string

func (*Sha) ReadAtFrom

func (s *Sha) ReadAtFrom(r io.ReaderAt, start int64) (n int64, err error)

func (*Sha) ReadFrom

func (s *Sha) ReadFrom(r io.Reader) (n int64, err error)

func (*Sha) Reset

func (s *Sha) Reset()

func (*Sha) ResetWith

func (a *Sha) ResetWith(b *Sha)

func (*Sha) ResetWithShaLike

func (a *Sha) ResetWithShaLike(b schnittstellen.ShaLike)

func (*Sha) Schwanz

func (s *Sha) Schwanz() string

func (*Sha) Set

func (s *Sha) Set(v string) (err error)

func (*Sha) SetFromHash

func (dst *Sha) SetFromHash(h hash.Hash) (err error)

func (*Sha) SetHexBytes

func (s *Sha) SetHexBytes(b []byte) (err error)

func (*Sha) SetParts

func (s *Sha) SetParts(a, b string) (err error)

func (*Sha) SetShaLike

func (dst *Sha) SetShaLike(src ShaLike) (err error)

func (*Sha) Sha

func (s *Sha) Sha() *Sha

func (*Sha) Size

func (s *Sha) Size() int

func (*Sha) String

func (s *Sha) String() string

func (*Sha) UnmarshalBinary

func (s *Sha) UnmarshalBinary(text []byte) (err error)

func (*Sha) UnmarshalText

func (s *Sha) UnmarshalText(text []byte) (err error)

func (*Sha) WriteTo

func (src *Sha) WriteTo(w io.Writer) (n int64, err error)

type ShaLike

type ShaLike = schnittstellen.ShaGetter

type WriteCloser

type WriteCloser = schnittstellen.ShaWriteCloser

TODO-P4 remove

Jump to

Keyboard shortcuts

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