Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidHasherSrc = errors.New("invalid input hasher source")
Functions ¶
This section is empty.
Types ¶
type Algo ¶
type Algo int
Algo Valid algorithms for integrity strings. Sha1 and Xxh3 are special cases in this library--they're not allowed by the current SRI spec, but they're useful enough that having first-class support makes sense. They should also be completely harmless to have in your strings if you do use it in a browser context--they just won't be used.
func (Algo) ToCryptoHash ¶
func (Algo) ToHashBuilder ¶
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
Hash Represents a single algorithm/digest pair. This is mostly internal, although users might interact with it directly on occasion.
type Integrity ¶
type Integrity struct {
// contains filtered or unexported fields
}
func NewIntegrityFromRawStr ¶
func (*Integrity) Join ¶
Join together two Integrity instances. Hashes will be grouped and sorted by algorithm but otherwise kept in the same order.
type IntegrityOpts ¶
type IntegrityOpts struct {
// contains filtered or unexported fields
}
func New ¶
func New() *IntegrityOpts
func (*IntegrityOpts) AddAlgo ¶
func (o *IntegrityOpts) AddAlgo(algo Algo) *IntegrityOpts
func (*IntegrityOpts) AddHash ¶
func (o *IntegrityOpts) AddHash(ch crypto.Hash) *IntegrityOpts
func (*IntegrityOpts) Input ¶
func (o *IntegrityOpts) Input(data []byte) *IntegrityOpts
func (*IntegrityOpts) InputStr ¶
func (o *IntegrityOpts) InputStr(data string) *IntegrityOpts
func (*IntegrityOpts) Result ¶
func (o *IntegrityOpts) Result() (*Integrity, error)
Click to show internal directories.
Click to hide internal directories.