[Overview][Constants][Types][Procedures and functions][Variables] | Reference for unit 'objpas' (#rtl) |
Create GNU Gettext hash value for a string
Source position: objpas.pp line 80
function Hash( |
S: AnsiString |
):LongWord; |
Hash calculates the hash value of the string S in a manner that is compatible with the GNU gettext hash value for the string. It is the same value that is stored in the Resource string tables, and which can be retrieved with the GetResourceStringHash function call.
None. In case the calculated hash value should be 0, the returned result will be -1.
|
Return hash value of resource string |
Program Example93; { Program to demonstrate the Hash function. } {$Mode Delphi} ResourceString First = 'First string'; Second = 'Second String'; Var I,J : Longint; begin For I:=0 to ResourceStringTableCount-1 do For J:=0 to ResourceStringCount(i)-1 do If Hash(GetResourceStringDefaultValue(I,J)) <>GetResourceStringHash(I,J) then Writeln ('Hash mismatch at ',I,',',J) else Writeln ('Hash (',I,',',J,') matches.'); end.
No notes exist for this page yet.