...und noch zwei Fehler. Diesmal bei mir.
Delphi-Quellcode:
procedure apgar(V: PChar; Outbuf: PChar);
const
Encoding = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./';
var
W: array [0..8] of Char;
I: Integer;
A: Integer;
begin
for I := 0 to 7 do
begin
A := Integer(V[I]);
// a & 1 ?
if Odd(A) then
W[I] := Encoding[((a shl ((a and 1) and V[8-I])) and $3F)+1]
else
W[I] := Encoding[((a xor V[8-I]) and $3F)+1];
end;
W[8] := #0;
Move(W[0], Outbuf[0], 8);
end;