Uuencode

The programs uuencode and its symmetrical uudecode are conversion programs of binary data into text, available to the near total of the systems Unix/Linux, it make it possible to convert without degradation of the binary data for their transmission via a support which would not allow it normally. These two programmes and the algorithm which they implement were treated a very great number of Operating systems. The name uuencode comes from Unix to Unix Encoding .

History

These two programs were written before the massive use of Internet so in particular that the software Suite UUCP can transport binary files fiablement. This software continuation allows communications inter-waiters via Modem and was initially conceived to exchange simple text (by using only part of the 128 characters ASCII).

They were mainly used for the transmission of messages (Email and forums Usenet) but today their use is largely replaced by the extensions MIME and in particular the encoding Base64 (which employs a portable character set more in encodé flow).

Principle of operation

The program uuencode produces a flow of text (a sucession of characters ASCII) of which the first line est : begin

where and is replaced respectively by the octal value representing the rights of access to place on the decoded file and by the name of the file to be built at the time of decoding. The encodées data flow ends in a line containing the texte  just;: end

Entre these two lines only the 65 following characters can be met: be ! " # $ % & '() * +, -. / 0 1 2 3 4 5 6 7 8 9: ; < = >? @ B C D E F G H I J K L MR. NR O HAS P Q R S T U V W X Y Z \ ^ _ ` the character noted be above is the character ASCII representing a space and whose numeric digital code is 32. The other characters change the numeric digital codes going from 32+1 to 32+64.

Program of encoding reads file of origin by group of three Byte S (possibly supplemented by Octet S of zero value if the number of Octet S with encoder is not mulitple of 3), then converts these three Octet S (that is to say 24 Bit S) into four groups of 6 Bit S each one, then to each group of 6 Bit S (which represents in base 10 a number ranging between 0 and 63) is added value 32, the resulting value is then the code ASCII one of the characters presented more high, this character is employed by the coder in the flow of exit.

The program of encoding also adds, and at the beginning of each line of produced text, the account of natures employed in this line and limit the size of the produced lines with 61 characters (either 45 Octet S encodés in 60 characters + 1 character for the length). This account of characters (going from 2 for only one Byte to 60 per 45 Byte S) is him even encodé by increasing it by 32 before being converts into a character ASCII in its turn.

Example

This example is used to illustrate the operation of the encodage  ; however as the bytes with encoder represent here the codes ASCII of a text, there would be no utility to use uuencode in this case. The text used in example is “Oh! ”  :

The encoding producing here exactly four bytes (and 4+32=36 is the code ASCII character $) the text emitted by the coder is donc : $3V@A

See too

References

  • IEEE Std 1003.1 helps on the use of the order uuencode
  • IEEE Std 1003.1 helps on the use of the order uudecode

Bonds

  • UUDeview programs Open-source for Unix/allowing Windows/DOS of encoder and to decode multiple ways

Random links:Anthem of Gibraltar | Holger Freitag | RRC Hamoir | Route main road 5 (Belgium) | Blue Monkey | Toute_la_fédération_du_football_de_l'Inde