Documentation
¶
Index ¶
Constants ¶
View Source
const ( // MD5 holds the identifier of the MD5 algorithm. MD5 = "md5" // SHA1 holds the identifier of the SHA1 algorithm. SHA1 = "sha1" // SHA256 holds the identifier of the SHA256 algorithm. SHA256 = "sha256" // SHA512 holds the identifier of the SHA512 algorithm. SHA512 = "sha512" // RIPEMD160 holds the identifier of the RIPEMD160 algorithm. RIPEMD160 = "ripemd160" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
Hash represents a set of input checksums calculated with several algorithms.
func NewHash ¶
func NewHash() *Hash
NewHash returns a new instance of Hash with pre populated algorithms.
func (*Hash) Close ¶
Close implements io.Closer. Checksums will not be considered valid until Close() got called.
type Input ¶
type Input interface { // Name returns the base name of the input file Name() string // Path returns the absolute path of the input file Path() string // Stem returns the inputs file name without the extension. // It will be used to create the file names of the output. Stem() string // Size returns the size of the input in bytes. // If the input size can not be determined, a negative number will be returned. Size() int64 }
Input describes an interface used by formats to get information about the input.
func NewFileInput ¶
NewFileInput creates an instance of Input representing a file input.
func NewStreamInput ¶
NewStreamInput returns an instance of Input representing an input passed via STDIN.
Click to show internal directories.
Click to hide internal directories.