...

Package ricrypto

import "github.com/dsoprea/go-utility/v2/crypto"
Overview
Index

Overview ▾

type ReaderHash32Proxy

ReaderHash32Proxy proxies a reader and produces a `Hash32` sum from the read bytes.

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

func NewReaderHash32Proxy

func NewReaderHash32Proxy(r io.Reader, h hash.Hash32) *ReaderHash32Proxy

NewReaderHash32Proxy returns a new `ReaderHash32Proxy` struct.

func (*ReaderHash32Proxy) Read

func (rhp *ReaderHash32Proxy) Read(b []byte) (n int, err error)

Read proxies the read to the underlying `Reader` while also pushing the bytes through the `Hash32` struct.

func (*ReaderHash32Proxy) Sum32

func (rhp *ReaderHash32Proxy) Sum32() uint32

Sum32 returns the accumulated hash value.

type ReaderHashProxy

ReaderHashProxy proxies a reader and produces a `Hash` sum from the read bytes.

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

func NewReaderHashProxy

func NewReaderHashProxy(r io.Reader, h hash.Hash) *ReaderHashProxy

NewReaderHashProxy returns a new `ReaderHashProxy` struct.

func (*ReaderHashProxy) Read

func (rhp *ReaderHashProxy) Read(b []byte) (n int, err error)

Read proxies the read to the underlying `Reader` while also pushing the bytes through the `Hash` struct.

func (*ReaderHashProxy) Sum

func (rhp *ReaderHashProxy) Sum() []byte

Sum returns the accumulated hash value.