Tutorial Addendum on Data Encoding - UUEncode Encoding

ios appcolt educationappsios financeappsios
 31 December 18:00   

    



    



    

UUEnccode Algorithm

    



    

UUEncode (Unix-to-Unix Encoding) was advised to address

    

the problem of sending bifold data book by email . It converts any data book

    

to a argument book with alone printable characters.

    



    

UUEncode was actual advantageous for email users in the aboriginal days, if email attachment

    

(MIME protocol) was not accessible yet. For example, if I wish to forward a argument message

    

in Chinese GB coding to a friend, I can not cover the GB codes anon in the

    

email body. I charge to uuencode (UUEncode encoding command) the GB codes into

    

printable characters. Then archetype those characters into the email body. If my friend

    

receives this email, he/she charge to uudecode (UUEncode adaptation command)

    

the printable characters aback to the aboriginal GB codes to apprehend the argument message

    

in Chinese.

    



    

The encoding action is to:

    



        

  • Divide the ascribe bytes beck into blocks of 3 bytes.

        



  •     

  • Divide the 24 $.25 of a 3-byte block into 4 groups of 6 bits.

        



  •     

  • Expand anniversary accumulation of 6 $.25 to 8 $.25 and add 32, x20, so the resulting

        

    bit map is apery an ASCII printable character.

        



  •     

  • If the endure 3-byte block has alone 1 byte of ascribe data, pad 2 bytes of 1 (x0101).

        



  •     

  • If the endure 3-byte block has alone 2 bytes of ascribe data, pad 1 byte of 1 (x01).

        



  •     



    



    

The printable characters acclimated by UUEncode encoding are listed in the following

    

table:

    

 

    

32 33 ! 34 " 35 # 36 $ 37 % 38 & 39

    

40 ( 41 ) 42 * 43 + 44 , 45 - 46 . 47 /

    

48 0 49 1 50 2 51 3 52 4 53 5 54 6 55 7

    

56 8 57 9 58 : 59 ; 60 < 61 = 62 > 63 ?

    

64 @ 65 A 66 B 67 C 68 D 69 E 70 F 71 G

    

72 H 73 I 74 J 75 K 76 L 77 M 78 N 79 O

    

80 P 81 Q 82 R 83 S 84 T 85 U 86 V 87 W

    

88 X 89 Y 90 Z 91 [ 92 93 ] 94 ^ 95 _

    



    



    

Example 1: Ascribe data, 1 byte, "A". Encoded output, 4 characters, "00$!"

    

 

    

Input Data A

    

Input $.25 01000001

    

Padding 01000001 00000001 00000001

    



    

Bit Groups 010000 010000 000100 000001

    

Adding 32 100000 100000 100000 100001

    

110000 110000 100100 100001

    

Output 0 0 $ !

    



    



    

Example 2: Ascribe data, 2 bytes, "AB". Encoded output, 4 characters, "04(!"

    

 

    

Input Data A B

    

Input $.25 01000001 01000010

    

Padding 01000001 01000010 00000001

    



    

Bit Groups 010000 010100 001000 000000

    

Adding 32 100000 100000 100000 100000

    

110000 110100 101000 100001

    

Output 0 4 ( !

    



    



    

Example 3: Ascribe data, 3 bytes, "ABC". Encoded output, 4 characters, "04)#"

    

 

    

Input Data A B C

    

Input $.25 01000001 01000010 01000011

    



    

Bit Groups 010000 010100 001001 000011

    

Adding 32 100000 100000 100000 100000

    

110000 110100 101001 100011

    

Output 0 4 ) #

    



    



    

Encoding achievement book formatting rules:

    



        

  • First band haveto be: "begin ooo filename", area "ooo" is the Unix book admission approach code,

        

    and "filename" is the book name of the ascribe data file.

        



  •     

  • Encoded achievement characters will be aggregate curve with 60 characters per line.

        



  •     

  • A adverse byte is amid at the alpha of anniversary line. It annal the amount of

        

    input data bytes encoded in this line. A amount of 32, x20, is added to this byte, so it

        

    becomes a printable character.

        



  •     

  • For a band of abounding 60 achievement characters, the arch counter

        

    byte will be "M", because there are 45 ascribe bytes, additional 32, consistent 77, which is

        

    the ASCII amount of "M". So you will see "M" in all the achievement curve except for the endure line,

        

    which will accept a abate value, if the amount of ascribe bytes is beneath than 45.

        



  •     

  • Two added curve are acclimated to end the achievement file. The first band has a individual byte of x20.

        

    The additional band has "end".

        



  •     



    



    



    

Sun Implementation

    



    

 


Tags: email, example, block, chinese, groups, characters, value, codes, lines

 input, characters, bytes, encoding, output, uuencode, encoded, printable, email, example, groups, lines, value, block, codes, , input data, 100000 100000, uuencode encoding, encoded output, groups 010000, bit groups, byte block, data file, printable characters, input bytes, 100000 100000 100000, bit groups 010000, 100000 100000 110000, 100000 110000 110100, groups 010000 010100, encoding uuencode encoding, data encoding uuencode, text messagein chinese,

Share Tutorial Addendum on Data Encoding - UUEncode Encoding:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Permalink
Article In : Computers & Technology  -  Encoding