home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / c / 18239 < prev    next >
Encoding:
Text File  |  1992-12-11  |  2.0 KB  |  59 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!munnari.oz.au!newsroom.utas.edu.au!probitas!dockhorn
  3. From: dockhorn@probitas.cs.utas.edu.au (Patrick Dockhorn)
  4. Subject: Re: A better mousetrap
  5. Message-ID: <dockhorn.724136821@probitas>
  6. Sender: news@newsroom.utas.edu.au
  7. Organization: University of Tasmania, Australia.
  8. References: <18287@mindlink.bc.ca>
  9. Date: Sat, 12 Dec 1992 05:07:01 GMT
  10. Lines: 47
  11.  
  12. >Bear with me folks.
  13.  
  14. >What I'm in the process of writing (or trying to write) is a more efficient
  15. >version of uuencode. I've noted that uuencode seems to cause 'file swelling',
  16. >on an average of 1:1.4 for binary files. (That is to say, a 100k binary
  17. >converts to a 140k ascii file.)
  18.  
  19. >What I've been busy cobbling together is something that could be more
  20. >efficient. To date, my best efforts yield a pathetic average of 1:1.74 ratio
  21. >for binaries.
  22.  
  23. uuencode converts 3 'binary bytes' into 4 printable ascii characters:
  24.  
  25. Byte 0   Byte 1   Byte 2
  26. 01234567 01234567 01234567
  27. AAAAAABB BBBBCCCC CCDDDDDD
  28.  
  29. The bits indicated by 'A' form the first character.
  30. uuencode simply adds a space to this value between
  31. 0 and 63 thus resulting in a printable ascii
  32. char.  The procedure continues with B, C and
  33. D.  There's also a special BEGIN-OF-LINE token
  34. to avoid problems with newlines.
  35.  
  36. uuencode was written to allow binary files to be
  37. sent by services that can't handle but printable
  38. characters, (uuencode uses ASCII 32 - 96). Within
  39. this conditions there's no way to improve it - the
  40. only thing is compression, but this is usually done
  41. as a separate process, i.e. you compress a file and
  42. uuencode it then.  I wrote my own uuencode/decode
  43. once because the standard one failed on an IBM 3090
  44. but this only increased the size of the files created
  45. and I used the same method and just added some more 
  46. control information. 
  47.  
  48. Thus, IMHO, I don't see a chance for an improvement 
  49. of uuencode.
  50.  
  51. -patsch
  52.  
  53. --
  54. The only possible interpretation of any research whatever in the
  55. `social sciences' is: some do, some don't.
  56.                 -- Ernest Rutherford
  57.  
  58.  
  59.