Documentation ¶
Index ¶
- Constants
- func HashHexToSha256(hexAscii string, sha256 *Sha256) error
- func HashSha256ToHexString(hash *Sha256) string
- type BasicHashStore
- func (bhs *BasicHashStore) AppendHash(hash *Sha256) (int64, error)
- func (bhs *BasicHashStore) Close() error
- func (bhs *BasicHashStore) CountHashes() (int64, error)
- func (bhs *BasicHashStore) GetHashAtIndex(index int64, hash *Sha256) error
- func (bhs *BasicHashStore) IndexOfHash(hash *Sha256) (int64, error)
- func (bhs *BasicHashStore) WholeFileAsInt32() ([]uint32, error)
- type ConcreteHashStoreCreator
- type HashReadWriter
- type HashReader
- type HashStore
- func (hs *HashStore) AppendHash(hash *Sha256) (int64, error)
- func (hs *HashStore) Close() error
- func (hs *HashStore) CountHashes() (int64, error)
- func (hs *HashStore) GetHashAtIndex(index int64, hash *Sha256) error
- func (hs *HashStore) IndexOfHash(hash *Sha256) (int64, error)
- func (hs *HashStore) WholeFileAsInt32() ([]uint32, error)
- type HashStoreCreator
- type ReadWriteSeekCloser
- type Sha256
Constants ¶
View Source
const ZEROBUF = 32 // Arbitrary number. Should be enough (we do check)
Variables ¶
This section is empty.
Functions ¶
func HashHexToSha256 ¶
func HashSha256ToHexString ¶
Types ¶
type BasicHashStore ¶
type BasicHashStore struct {
// contains filtered or unexported fields
}
func NewBasicHashStore ¶
func NewBasicHashStore(file ReadWriteSeekCloser) *BasicHashStore
func (*BasicHashStore) AppendHash ¶
func (bhs *BasicHashStore) AppendHash(hash *Sha256) (int64, error)
func (*BasicHashStore) Close ¶
func (bhs *BasicHashStore) Close() error
func (*BasicHashStore) CountHashes ¶
func (bhs *BasicHashStore) CountHashes() (int64, error)
func (*BasicHashStore) GetHashAtIndex ¶
func (bhs *BasicHashStore) GetHashAtIndex(index int64, hash *Sha256) error
func (*BasicHashStore) IndexOfHash ¶
func (bhs *BasicHashStore) IndexOfHash(hash *Sha256) (int64, error)
IndexOfHash This is a very slow naive implementation, and should only be used for testing
func (*BasicHashStore) WholeFileAsInt32 ¶
func (bhs *BasicHashStore) WholeFileAsInt32() ([]uint32, error)
type ConcreteHashStoreCreator ¶
type ConcreteHashStoreCreator struct {
// contains filtered or unexported fields
}
func (*ConcreteHashStoreCreator) CreateHashStore ¶
func (hsc *ConcreteHashStoreCreator) CreateHashStore() error
func (*ConcreteHashStoreCreator) HashStoreExists ¶
func (hsc *ConcreteHashStoreCreator) HashStoreExists() bool
func (*ConcreteHashStoreCreator) OpenHashStore ¶
func (hsc *ConcreteHashStoreCreator) OpenHashStore() (HashReadWriter, error)
func (*ConcreteHashStoreCreator) OpenHashStoreReadOnly ¶
func (hsc *ConcreteHashStoreCreator) OpenHashStoreReadOnly() (HashReader, error)
type HashReadWriter ¶
type HashReadWriter interface { HashReader AppendHash(hash *Sha256) (int64, error) }
type HashReader ¶
type HashStore ¶
type HashStore struct {
// contains filtered or unexported fields
}
func NewHashStore ¶
func (*HashStore) CountHashes ¶
func (*HashStore) GetHashAtIndex ¶
func (*HashStore) IndexOfHash ¶
IndexOfHash -1 indicates "Not Present" but error will be nil if that's all that is wrong
func (*HashStore) WholeFileAsInt32 ¶
type HashStoreCreator ¶
type HashStoreCreator interface { HashStoreExists() bool CreateHashStore() error OpenHashStore() (HashReadWriter, error) OpenHashStoreReadOnly() (HashReader, error) }
type ReadWriteSeekCloser ¶
type ReadWriteSeekCloser interface { io.ReadWriteSeeker io.Closer }
Click to show internal directories.
Click to hide internal directories.