Einzelnen Beitrag anzeigen

a.def
(Gast)

n/a Beiträge
 
#5

AW: Gemeinsamer Vorfahre von DEC THash_XYZ gesucht

  Alt 3. Mai 2017, 10:17
Wie rufst du denn CalcHash auf?.
So sieht das bei mir aus
Delphi-Quellcode:
function CalcHash(input: string; aHashMethod: TDECHash): string;
var
 val: TStringStream;
 aHash: TDECHash;
 len: Int64;
begin
 val := TStringStream.Create;
 try
  len := Length(input);
  val.Write(input[1], len);
  val.Position := 0;

  aHash := aHashMethod.Create;
  try
   Result := string(aHash.CalcStream(val, len, TFormat_HEX));
  finally
   aHash.Free;
  end;
 finally
  val.Free;
 end;
Aufruf lautet s := CalcHash(s, TDECHash(THash_SHA256));
  Mit Zitat antworten Zitat