THashAlgorithm
An abstract base class for algorithms that calculate a hash value for arbitrary streams of bytes.
Inheritance
Level | Ancestor | Description |
---|---|---|
1 | TObject | Ultimate ancestor in a class hierarchy |
2 | TOutputStream | A stream of bytes that can be written from front to end. |
3 | THashAlgorithm |
Source
Hash.Algorithm.pas (32)
Description
THashAlgorithm
extends TOutputStream
which allows users to efficiently write arbitrary data
to the hash algorithm. Once all data has been written, Digest
can be called to flush internal buffers and
produce the resulting hash value.
Fields
Scope | Visibility | Type | Name | Description |
---|---|---|---|---|
Instance | private | TMemoryBlock | Buffer | |
Instance | private | TOutputStream | BufferStream | |
Instance | private | TPositiveInteger64 | Size | |
Instance | private | TPositiveInteger32 | Index |
Methods
Scope | Visibility | Result | Name | Description |
---|---|---|---|---|
Instance | protected | Compress(Stream: TInputStream) | ||
Instance | protected | WriteHash(Stream: TOutputStream) | ||
Instance | protected | WriteSize(Stream: TOutputStream; Size: TPositiveInteger64) | ||
Instance | protected | Initialize() | ||
Instance | protected | Finalize() | ||
Instance | protected | AssignFrom(Source: THashAlgorithm) | ||
Instance | protected | CompressBuffer() | ||
Type | protected | TPositiveInteger32 | GetByteCountForSize() | |
Instance | public | Create() | ||
Instance | public | Destroy() | ||
Instance | public | Write(Buffer; Count: TPositiveInteger32) | ||
Instance | public | THashAlgorithm | Copy() | Copies the entire current internal state of the algorithm so it can be used independently of this instance. |
Instance | public | TMemoryBlock | Digest() | Produces the hash for the data that has been written to the algorithm and reinitializes the internal state of the algorithm so it can be used again. |
Type | public | TInteger32 | GetHashSize() | Returns the size in bytes of the hash that is produced by the algorithm. |
Type | public | TInteger32 | GetBlockSize() | Returns the size in bytes of the blocks that the algorithm operates on internally. |
Type | public | TMemoryBlock | Compute(Input: TByteBlock) |