System.Hash.THashSHA1
Delphi
THashSHA1 = record
C++
struct DECLSPEC_DRECORD THashSHA1
{
private:
System::StaticArray<unsigned, 5> FHash;
__int64 FBitLength;
System::StaticArray<System::Byte, 64> FBuffer;
int FIndex;
bool FFinalized;
void __fastcall Initialize();
void __fastcall CheckFinalized();
void __fastcall Compress();
void __fastcall Finalize();
System::Sysutils::TBytes __fastcall GetDigest();
void __fastcall Update(const System::PByte AData, unsigned ALength)/* overload */;
public:
static THashSHA1 __fastcall Create();
void __fastcall Reset();
void __fastcall Update(const void *AData, unsigned ALength)/* overload */;
void __fastcall Update(const System::Sysutils::TBytes AData, unsigned ALength = (unsigned)(0x0))/* overload */;
void __fastcall Update(const System::UnicodeString Input)/* overload */;
int __fastcall GetBlockSize();
int __fastcall GetHashSize();
System::Sysutils::TBytes __fastcall HashAsBytes();
System::UnicodeString __fastcall HashAsString();
static System::Sysutils::TBytes __fastcall GetHashBytes(const System::UnicodeString AData)/* overload */;
static System::UnicodeString __fastcall GetHashString(const System::UnicodeString AString)/* overload */;
static System::Sysutils::TBytes __fastcall GetHashBytes(System::Classes::TStream* const AStream)/* overload */;
static System::UnicodeString __fastcall GetHashString(System::Classes::TStream* const AStream)/* overload */;
static System::Sysutils::TBytes __fastcall GetHashBytesFromFile(const System::Sysutils::TFileName AFileName);
static System::UnicodeString __fastcall GetHashStringFromFile(const System::Sysutils::TFileName AFileName);
static System::UnicodeString __fastcall GetHMAC(const System::UnicodeString AData, const System::UnicodeString AKey);
static System::Sysutils::TBytes __fastcall GetHMACAsBytes(const System::UnicodeString AData, const System::UnicodeString AKey)/* overload */;
static System::Sysutils::TBytes __fastcall GetHMACAsBytes(const System::UnicodeString AData, const System::Sysutils::TBytes AKey)/* overload */;
static System::Sysutils::TBytes __fastcall GetHMACAsBytes(const System::Sysutils::TBytes AData, const System::UnicodeString AKey)/* overload */;
static System::Sysutils::TBytes __fastcall GetHMACAsBytes(const System::Sysutils::TBytes AData, const System::Sysutils::TBytes AKey)/* overload */;
};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
record struct |
public | System.Hash.pas System.Hash.hpp |
System.Hash | System.Hash |
Description
A record that implements the SHA-1 hash type.
THashSHA1 provides methods such as:
- Update: Updates the hash value with the provided data.
- GetHashString: Returns hash value of the provided String.
- GetHashStringFromFile: Returns hash value of the provided file.
- GetHMAC: Returns a String representation associated with the HMAC authentication (Hash-based message authentication code).