Bitwise operations and md4digest function

Alejandro Tejada capellan2000 at yahoo.com
Wed Nov 23 10:03:54 EST 2005


Hi all,

i've been porting this md4digest function
from Macromedia Director to Runtime Revolution:
<http://www.isometrik.org/md5/lingo_md4_fastest.txt>

Some differences i had noticed while handling
numbers are:

Numeric Arrays in Director starts from 0 (zero)
Numeric Arrays in Runrev starts from 1 (one)

In Director:
put (24 + 64) / 512 * 16 + 16
results in 16

In RunRev 
put (24 + 64) / 512 * 16 + 16
results in 18.75

To get the same result in RunRev
i had to rewrite the operation like this:
put round((24 + 64)/( 512 * 16)) + 16

More problematic is that bitwise operations
do not return the same results in
Director and Runrev... for example

in Director
put bitAnd(-271733879,-1732584194)
returns -2004318072 

in RunRev
put -271733879 bitand -1732584194
returns 0 (zero)

How could i get the same the result in RunRev as
this bitAnd operation made in Director?

Thanks in advance.

alejandro

Visit my site:
http://www.geocities.com/capellan2000/


		
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com



More information about the use-livecode mailing list