Xref: utzoo comp.sys.atari.st:8883 comp.sys.mac:14846 Path: utzoo!utgpu!water!ljdickey From: ljdickey@water.waterloo.edu (Lee Dickey) Newsgroups: comp.sys.atari.st,comp.sys.mac Subject: Re: binHex in atari ST Message-ID: <1505@water.waterloo.edu> Date: 7 Apr 88 04:34:33 GMT References: <1537@alliant.Alliant.COM> Reply-To: ljdickey@water.waterloo.edu (Lee Dickey) Organization: U. of Waterloo, Ontario Lines: 39 In article <1537@alliant.Alliant.COM> rosenkra@alliant.UUCP (Bill Rosenkranz) writes: >is binHex in the public domain or is it a commercial/proprietary product? >can source be obtained? if so could it be posted in comp.sources.atari.st? >better yet: has binHex been ported to the atari? if so could someone please >post/email to me? There are probably many who use BinHex or UU{en,de}CODE without without knowing what they do, and there are probably others who do not know about the existence of the "other" encoding function. BinHex is an easy enough program to write. Its purpose is to turn a binary file into something that has only printable characters, so that it can be e-mailed over networks that might respond to control characters, and, perhaps, ( cough, gasp ) be read! Each OCTET ( 8 bit byte ) of the binary file is split into two nibbles, 4 bits each. Each nibble is used as a pointer to index into the vector "0123456789ABCDEF" with 16 elements. Thus, for each byte of the binary file, you get two hexadecimal characters. The result is a file with twice as many characters as the original file. Some people have become experts at reading this stuff. Their heads have 16 sides. They will become telephone sanitizers. :-) On the other hand, the UUencode program does an encoding that takes each set of three octets (24 bits) and produces 4 printable characters, by a rule that uses each set of 6 bits to index into a vector string with 64 elements. You can see what these are by looking at a UUencoded file. The result is a file 4/3 the size of the original. The inverse function is UUdecode. Most folks that have UUencode-UUdecode are not interested in BinHex. Probably the best functions of this type are UUE and UUD done by J-P Dumas. -- L. J. Dickey, Faculty of Mathematics, University of Waterloo. ljdickey@waterloo.edu ljdickey@WATDCS.UWaterloo.ca ljdickey@water.BITNET ljdickey@water.UUCP or ...!uunet!water!ljdickey