Show: Object Pascal C++
Display Preferences

System.Hash.THashBobJenkins

From Appmethod Libraries
Jump to: navigation, search

Object Pascal

  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 */;
};

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 Jenkins hash type.

THashBobJenkins provides methods such as:

  • Update: Updates the hash value with the provided data.
  • GetHashValue: Returns hash value of the provided data.
  • HashAsString: Returns a String representation of the hash value.

See Also

Personal tools
Translations