-


XXEncode XXDecode - 2


if XXCode then

for i:=0 to 3 do

Kwartet[i] := Ord(XX[(Kwartet[i] - Ord(SP)) mod $40])

end {Triplet2Kwartet};

Triplet2Kwartet XXencode . , UUEncode , #32, XXencode UUEncode, 32 XXencode.

Kwartet2Triplet, XXencode UUdecode (, Kwartet const).

procedure Kwartet2Triplet(Kwartet: TKwartet;

var Triplet: TTriplet);

var

i: Integer;

begin

if

XXCode then

begin

for

i:=0 to 3 do

begin

case

Chr(Kwartet[i]) of

'+': Kwartet[i] := 0 + Ord(SP);

'-': Kwartet[i] := 1 + Ord(SP);

'0'..'9': Kwartet[i] := 2 + Kwartet[i]

- Ord('0') + Ord(SP);

'A'..'Z': Kwartet[i] := 12 + Kwartet[i]

- Ord('A') + Ord(SP);

'a'..'z': Kwartet[i] := 38 + Kwartet[i]

- Ord('a') + Ord(SP)

end

end

end;

Triplet[0] := ((Kwartet[0] - Ord(SP)) SHL 2) +

(((Kwartet[1] - Ord(SP)) AND $30) SHR

4);

Triplet[1] := (((Kwartet[1] - Ord(SP)) AND $0F) SHL

4) +

(((Kwartet[2] - Ord(SP)) AND $3C) SHR

2);

Triplet[2] := (((Kwartet[2] - Ord(SP)) AND $03) SHL

6) +

((Kwartet[3] - Ord(SP)) AND $3F)

end

{Kwartet2Triplet};

, XXCode .