|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] RE: Section 4.1 clarificationsMichael, I hadn't thought about that aspect, but it would be a computational pain. One could assemble the binary number by doing decimal math on the decimal encoding: Repeat the following until the quotient is zero. Divide the decimal string by 2^n Convert the remainder to an n-bit binary number and append to the high order end of the binary result Replace the decimal string with the quotient It is possible but not very pretty and I don't think making decimal encoding available for long strings is worth the trouble. Pat -----Original Message----- From: Michael Krueger [mailto:michael.krueger@windriver.com] Sent: Thursday, April 25, 2002 2:42 PM To: THALER,PAT (A-Roseville,ex1); Julian Satran Actually, I'm concerned neither with storage space nor with speed, but rather with code complexity. Unlike hexadecimal and base-64 encoding, there is not a simple correspondence between decimal digits in the string representation and bit locations in the binary item. Most implementation of decimal-to-binary conversion functions like strtoul() do integer arithmetic to obtain the binary representation, but this isn't feasible for binary items larger than 4 (or, at an absolute maximum, 8) bytes. Show me a simple algorithm or a widely available library function for converting a 2,467-digit string to its 1024-byte binary representation, and I'll use it; otherwise, support for decimal encoding of large binary items seems like a needless complication that pays back very little added value. Michael -- Michael J. Krueger mailto:michael.krueger@windriver.com Wind River Networks http://www.windriver.com 500 Wind River Way phone: 510-749-2130 Alameda, CA 94501 fax: 510-749-2010
Home Last updated: Thu Apr 25 23:18:22 2002 9803 messages in chronological order |