Conversion Chart

JB sundown at pacifier.com
Thu Oct 2 19:10:58 EDT 2014


That is what I was using and it works for ascii to Hex, ascii to Binary,
Hex to ascii, Hex to binary, binary to ascii and then if you don’t have
a lot of characters and you only call it from one line it works for binary
to hex.  In other words don’t use if for binary to hex unless you only
are processing a few sets of 8 digit chars to hex and they are not
on different lines.  I even put them all on separate lines and only
took the eight chars so there were no returns to strip.  Any one
line out of many thousand will work but when you try to convert
another line it will not work but it might give you the appearance
that it worked.

John Balgenorth


On Oct 2, 2014, at 3:53 PM, Peter Haworth <pete at lcsql.com> wrote:

> I might be missing something but what's wrong with using the baseConvert
> function?  It converts a number from any base to any base.
> 
> Pete
> lcSQL Software <http://www.lcsql.com>
> Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
> SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
> 
> On Thu, Oct 2, 2014 at 1:19 PM, JB <sundown at pacifier.com> wrote:
> 
>> Here is another chart.
>> 
>> 
>> Hex - Binary
>> 0    0000
>> 1    0001
>> 2    0010
>> 3    0011
>> 4    0100
>> 5    0101
>> 6    0110
>> 7    0111
>> 8    1000
>> 9    1001
>> A    1010
>> B    1011
>> C    1100
>> D    1101
>> E    1110
>> F    1111
>> 
>> 
>> The binary code is eight chars long.  The Hex code
>> is two chars long.  To convert from Binary to Hex you
>> use this chart.
>> 
>> Take a list of binary data and it will be a group of eight
>> char sections.  You take the first eight chars and now
>> you will be dealing with the first Hex char.  As I said
>> before Hex is numbers 0 to 9 and letters  A to F and
>> these letters can be upper or lower case but keep it
>> consistent.
>> 
>> Now that you have eight Binary digits that represent
>> one Hex value you take the first four binary digits and
>> convert them to the Hex value in the chart and then you
>> take the second four Binary digits and convert them to
>> the Hex value shown in the chart.  Now you have your
>> two digit Hex value.
>> 
>> John Balgenorth
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 





More information about the use-livecode mailing list