var
// DEC5_xyz entspricht der unit xyz aus DEC 5 (hab sie nur umbenannt)
strResultV3: ANSIString;
strResultV5: ANSIString;
cResult: Cardinal;
objCRCDef: DEC5_CRC.TCRCDef;
strKey: ANSIString;
cVector: Cardinal;
begin
// DEC 3 Variante:
// strResultV3 := Hash.THash_CRC32.CalcString(FText, TMAC.Create(FPassword, nil), fmtHEX);
// BEGIN TMAC5.Create(...) Entsprechung
// neuen Startwert berechnen
cVector := $FFFFFFFF;
DEC5_CRC.CRCSetup(objCRCDef, $04C11DB7, 32, $FFFFFFFF, $FFFFFFFF, True);
DEC5_CRC.CRCCode(objCRCDef, PAnsiCHar(FPassword)^, Length(FPassword));
cResult := DEC5_CRC.CRCDone(objCRCDef);
strKey := DEC5_DECFmt.TFormat_Copy.Encode(cResult, 4);
DEC5_DECUtil.XORBuffers(cVector, PAnsiChar(strKey)^, Length(strKey), cVector);
// Damit CRC wieder initialisieren
FillChar(objCRCDef, SizeOf(objCRCDef), #0);
DEC5_CRC.CRCSetup(objCRCDef, $04C11DB7, 32, $FFFFFFFF, $FFFFFFFF, True);
objCRCDef.CRC := cVector;
// END TMAC5.Create(...) Entsprechung
// und damit den Hash-Wert nun entgueltig berechnen
cResult := DEC5_CRC.CRCCode(objCRCDef, PAnsiCHar(FText)^, Length(FText));
cResult := DEC5_CRC.CRCDone(objCRCDef);
strResultV5 := DEC5_DECFmt.TFormat_HEX.Encode(cResult, 4);
// CheckEqualsString(strResultV3, strResultV5);
end;