Documentation ¶
Index ¶
- Variables
- func Checksum(src io.Reader, checksum DigestAlgorithm) (string, error)
- func Copy(checksums []DigestAlgorithm, src io.Reader, dst ...io.Writer) (map[DigestAlgorithm]string, error)
- func GetHash(csType DigestAlgorithm) (hash.Hash, error)
- func HashExists(csType DigestAlgorithm) bool
- type ChecksumWriter
- type DigestAlgorithm
- type NullWriter
- type WriterRunnerChecksum
Constants ¶
This section is empty.
Variables ¶
View Source
var DigestNames = maps.Keys(hashFunc)
Functions ¶
func Copy ¶
func Copy(checksums []DigestAlgorithm, src io.Reader, dst ...io.Writer) (map[DigestAlgorithm]string, error)
func HashExists ¶
func HashExists(csType DigestAlgorithm) bool
Types ¶
type ChecksumWriter ¶
type ChecksumWriter struct {
// contains filtered or unexported fields
}
func NewChecksumWriter ¶
func NewChecksumWriter(checksums []DigestAlgorithm, writers ...io.Writer) (*ChecksumWriter, error)
func (*ChecksumWriter) Close ¶
func (c *ChecksumWriter) Close() error
func (*ChecksumWriter) GetChecksums ¶
func (c *ChecksumWriter) GetChecksums() (map[DigestAlgorithm]string, error)
type DigestAlgorithm ¶
type DigestAlgorithm string
const ( DigestMD5 DigestAlgorithm = "md5" DigestSHA1 DigestAlgorithm = "sha1" DigestSHA256 DigestAlgorithm = "sha256" DigestSHA512 DigestAlgorithm = "sha512" DigestBlake2b160 DigestAlgorithm = "blake2b-160" DigestBlake2b256 DigestAlgorithm = "blake2b-256" DigestBlake2b384 DigestAlgorithm = "blake2b-384" DigestBlake2b512 DigestAlgorithm = "blake2b-512" )
func (*DigestAlgorithm) UnmarshalText ¶ added in v2.0.9
func (d *DigestAlgorithm) UnmarshalText(text []byte) error
type WriterRunnerChecksum ¶
type WriterRunnerChecksum struct {
// contains filtered or unexported fields
}
func NewWriterRunnerChecksum ¶
func NewWriterRunnerChecksum(alg DigestAlgorithm) (*WriterRunnerChecksum, error)
func (*WriterRunnerChecksum) Do ¶
func (w *WriterRunnerChecksum) Do(reader io.Reader, done chan bool)
func (*WriterRunnerChecksum) GetAlgorithm ¶
func (w *WriterRunnerChecksum) GetAlgorithm() DigestAlgorithm
func (*WriterRunnerChecksum) GetDigest ¶
func (w *WriterRunnerChecksum) GetDigest() (string, error)
func (*WriterRunnerChecksum) GetName ¶
func (w *WriterRunnerChecksum) GetName() string
Click to show internal directories.
Click to hide internal directories.