Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashingWriter ¶
type HashingWriter struct {
// contains filtered or unexported fields
}
HashingWriter wraps an io.Writer, providing the checksum of all data written to it. A HashingWriter may be used in place of the writer it wraps.
func NewHashingWriter ¶
func NewHashingWriter(writer io.Writer, hasher hash.Hash) *HashingWriter
NewHashingWriter returns a new HashingWriter that wraps the provided writer and the hasher.
Example:
hw := NewHashingWriter(w, sha1.New()) io.Copy(hw, reader) hash := hw.Base64Sum()
func (*HashingWriter) Base64Sum ¶
func (h *HashingWriter) Base64Sum() string
Base64Sum returns the base64 encoded hash.
func (*HashingWriter) HexSum ¶
func (h *HashingWriter) HexSum() string
HexSum returns the hex-ified checksum.
Click to show internal directories.
Click to hide internal directories.