System.Hash.THashBobJenkins
Delphi
THashBobJenkins = record
private
FHash: Integer;
function GetDigest: TBytes;
class function HashLittle(const Data; Len, InitVal: Integer): Integer; static;
public
class function Create: THashBobJenkins; static;
procedure Reset(AInitialValue: Integer = 0);
procedure Update(const AData; ALength: Cardinal); overload; inline;
procedure Update(const AData: TBytes; ALength: Cardinal = 0); overload; inline;
procedure Update(const Input: string); overload; inline;
function HashAsBytes: TBytes;
function HashAsInteger: Integer;
function HashAsString: string;
class function GetHashBytes(const AData: string): TBytes; static;
class function GetHashString(const AString: string): string; static;
class function GetHashValue(const AData: string): Integer; overload; static; inline;
class function GetHashValue(const AData; ALength: Integer; AInitialValue: Integer = 0): Integer; overload; static; inline;
end;
C++
struct DECLSPEC_DRECORD THashBobJenkins
{
private:
int FHash;
#ifndef _WIN64
System::DynamicArray<System::Byte> __fastcall GetDigest(void);
#else /* _WIN64 */
System::TArray__1<System::Byte> __fastcall GetDigest(void);
#endif /* _WIN64 */
static int __fastcall HashLittle(const void *Data, int Len, int InitVal);
public:
static THashBobJenkins __fastcall Create();
void __fastcall Reset(int AInitialValue = 0x0);
void __fastcall Update(const void *AData, unsigned ALength)/* overload */;
#ifndef _WIN64
void __fastcall Update(const System::DynamicArray<System::Byte> AData, unsigned ALength = (unsigned)(0x0))/* overload */;
#else /* _WIN64 */
void __fastcall Update(const System::TArray__1<System::Byte> AData, unsigned ALength = (unsigned)(0x0))/* overload */;
#endif /* _WIN64 */
void __fastcall Update(const System::UnicodeString Input)/* overload */;
#ifndef _WIN64
System::DynamicArray<System::Byte> __fastcall HashAsBytes(void);
#else /* _WIN64 */
System::TArray__1<System::Byte> __fastcall HashAsBytes(void);
#endif /* _WIN64 */
int __fastcall HashAsInteger(void);
System::UnicodeString __fastcall HashAsString(void);
#ifndef _WIN64
static System::DynamicArray<System::Byte> __fastcall GetHashBytes(const System::UnicodeString AData);
#else /* _WIN64 */
static System::TArray__1<System::Byte> __fastcall GetHashBytes(const System::UnicodeString AData);
#endif /* _WIN64 */
static System::UnicodeString __fastcall GetHashString(const System::UnicodeString AString);
static int __fastcall GetHashValue(const System::UnicodeString AData)/* overload */;
static int __fastcall GetHashValue(const void *AData, int ALength, int AInitialValue = 0x0)/* overload */;
};
プロパティ
種類 | 可視性 | ソース | ユニット | 親 |
---|---|---|---|---|
record struct |
public | System.Hash.pas System.Hash.hpp |
System.Hash | System.Hash |
説明
Jenkins ハッシュを実装するレコードです。
THashBobJenkins には、以下のようなメソッドが用意されています。
- Update: 渡されたデータを使ってハッシュ値を更新します。
- GetHashValue: 渡されたデータのハッシュ値を返します。
- HashAsString: ハッシュ値の文字列表現を返します。