Printer Friendly
Dictionary, Encyclopedia and Thesaurus - The Free Dictionary
1,805,624,358 visitors served.
forum mailing list For webmasters
?
New: Language forums
Dictionary/
thesaurus
Medical
dictionary
Legal
dictionary
Financial
dictionary
Acronyms
 
Idioms
Encyclopedia
Wikipedia
encyclopedia
?

btoa

   Also found in: Acronyms 0.04 sec.
(tool, messaging, algorithm, file format)btoa - /B too A/ A binary to ASCII conversion utility.

btoa is a uuencode or base 64 equivalent which addresses some of the problems with the uuencode standard but not as many as the base 64 standard. It avoids problems that some hosts have with spaces (e.g. conversion of groups of spaces to tabs) by not including them in its character set, but may still have problems on non-ASCII systems (e.g. EBCDIC).

btoa is primarily used to transfer binary files between systems across connections which are not eight-bit clean, e.g. electronic mail.

btoa takes adjacent sets of four binary octets and encodes them as five ASCII octets using ASCII characters '!' through to 'u'. Special characters are also used: 'x' marks the beginning or end of the archive; 'z' marks four consecutive zeros and 'y' (version 5.2) four consecutive spaces.

Each group of four octets is processed as a 32-bit integer. Call this 'I'. Let 'D' = 85^4. Divide I by D. Call this result 'R'. Make I = I - (R * D) to avoid overflow on the next step. Repeat, for values of D = 85^3, 85^2, 85 and 1. At each step, to convert R to the output character add decimal 33 (output octet = R + ASCII value for '!'). Five output octets are produced.

btoa provides some integrity checking in the form of a line checksum, and facilities for patching corrupted downloads.

The algorithm used by btoa is more efficient than uuencode or base 64. ASCII files are encoded to about 120% the size of their binary sources. This compares with 135% for uuencode or base 64.

C source. (version 5.2 - ~1994).

Pre-compiled MS-DOS versions are also available.


How to thank TFD for its existence? Tell a friend about us, add a link to this page, add the site to iGoogle, or visit webmaster's page for free fun content.
?Page tools
Printer friendly
Cite / link
Email
Feedback
? Mentioned in
 
Encyclopedia browser? ? Full browser
 
 
Encyclopedia
?

Disclaimer | Privacy policy | Feedback | Copyright © 2009 Farlex, Inc.
All content on this website, including dictionary, thesaurus, literature, geography, and other reference data is for informational purposes only. This information should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. Terms of Use.