-



Base


Base64 UUencode XXencode , . 64 .

Base64

0 A

8 I

16 Q

24 Y

32 g

40 o

48 w

56 4

1 B

9 J

17 R

25 Z

33 h

41 p

49 x

57 5

2 C

10 K

18 S

26 a

34 I

42 q

50 y

58 6

3 D

11 L

19 T

27 b

35 j

43 r

51 z

59 7

4 E

12 M

20 U

28 c

36 k

44 s

52 0

60 8

5 F

13 N

21 V

29 d

37 l

45 t

53 1

61 9

6 G

14 O

22 W

30 e

38 m

46 u

54 2

62 +

7 H

15 P

23 X

31 f

39 n

47 v

55 3

63 /

XXencode, Base64 ASCII.

, Base64 Triplet2Kwartet Kwartet2Triplet :

const

B64: Array[0..63] of Char =

'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';

procedure Triplet2Kwartet(Const Triplet: TTriplet;

var Kwartet: TKwartet);

var

i: Integer;

begin

Kwartet[0] := (Triplet[0] SHR 2);

Kwartet[1] := ((Triplet[0] SHL 4) AND $30) +

((Triplet[1] SHR 4) AND $0F);

Kwartet[2] := ((Triplet[1] SHL 2) AND $3C) +

((Triplet[2] SHR 6) AND $03);

Kwartet[3] := (Triplet[2] AND $3F);

for i:=0 to 3 do

if Kwartet[i] = 0 then

Kwartet[i] := $40 + Ord(SP)

else Inc(Kwartet[i],Ord(SP));

if Base64 then

for i:=0 to 3 do

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

else

if XXCode then

for i:=0 to 3 do

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