hashutil

package
v0.0.0-...-7a50bc8 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMd5Valid

func IsMd5Valid(s string) bool

Simple function that allows verification that a string is in fact a valid MD5 formated string.

func IsSha1Valid

func IsSha1Valid(s string) bool

Simple function that allows verification that a string is in fact a valid sha1 formated string.

func IsSha256Valid

func IsSha256Valid(s string) bool

Simple function that allows verification that a string is in fact a valid SHA256 formated string.

func IsSha512Valid

func IsSha512Valid(s string) bool

Simple function that allows verification that a string is in fact a valid SHA512 formated string.

Types

type Md5Reader

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

Intermediate Reader object that will calculate the MD5 value of the data that passes through it.

func NewMd5

func NewMd5(r io.Reader) *Md5Reader

Returns a new Md5Reader.

func (Md5Reader) Close

func (m Md5Reader) Close() error

Closes the source, if it implements io.Closer.

func (Md5Reader) Length

func (m Md5Reader) Length() int64

Returns the number of bytes passed through this reader.

func (*Md5Reader) Md5

func (m *Md5Reader) Md5() string

Returns the MD5 for all data that has been passed through this Reader already. This should ideally be called after the Reader is Closed, but otherwise its safe to call any time.

func (Md5Reader) Read

func (m Md5Reader) Read(p []byte) (n int, err error)

Reads from the source, and returns the values upstream after adding the data to the hash.

type Sha1Reader

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

Intermediate Reader object that will calculate the SHA1 value of the data that passes through it.

func NewSha1

func NewSha1(r io.Reader) *Sha1Reader

Returns a new Sha1Reader.

func (Sha1Reader) Close

func (m Sha1Reader) Close() error

Closes the source, if it implements io.Closer.

func (Sha1Reader) Length

func (m Sha1Reader) Length() int64

Returns the number of bytes passed through this reader.

func (Sha1Reader) Read

func (m Sha1Reader) Read(p []byte) (n int, err error)

Reads from the source, and returns the values upstream after adding the data to the hash.

func (*Sha1Reader) Sha1

func (s *Sha1Reader) Sha1() string

Returns the SHA1 for all data that has been passed through this Reader already. This should ideally be called after the Reader is Closed, but otherwise its safe to call any time.

type Sha256Reader

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

Intermediate Reader object that will calculate the SHA256 value of the data that passes through it.

func NewSha256

func NewSha256(r io.Reader) *Sha256Reader

Returns a new Sha256Reader.

func (Sha256Reader) Close

func (m Sha256Reader) Close() error

Closes the source, if it implements io.Closer.

func (Sha256Reader) Length

func (m Sha256Reader) Length() int64

Returns the number of bytes passed through this reader.

func (Sha256Reader) Read

func (m Sha256Reader) Read(p []byte) (n int, err error)

Reads from the source, and returns the values upstream after adding the data to the hash.

func (*Sha256Reader) Sha256

func (s *Sha256Reader) Sha256() string

Returns the SHA256 for all data that has been passed through this Reader already. This should ideally be called after the Reader is Closed, but otherwise its safe to call any time.

type Sha512Reader

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

Intermediate Reader object that will calculate the SHA512 value of the data that passes through it.

func NewSha512

func NewSha512(r io.Reader) *Sha512Reader

Returns a new Sha512Reader.

func (Sha512Reader) Close

func (m Sha512Reader) Close() error

Closes the source, if it implements io.Closer.

func (Sha512Reader) Length

func (m Sha512Reader) Length() int64

Returns the number of bytes passed through this reader.

func (Sha512Reader) Read

func (m Sha512Reader) Read(p []byte) (n int, err error)

Reads from the source, and returns the values upstream after adding the data to the hash.

func (*Sha512Reader) Sha512

func (s *Sha512Reader) Sha512() string

Returns the SHA512 for all data that has been passed through this Reader already. This should ideally be called after the Reader is Closed, but otherwise its safe to call any time.

Jump to

Keyboard shortcuts

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