NutStomper Posted August 25, 2012 Share Posted August 25, 2012 (edited) Edited July 13, 2013 by NutStomper Link to comment Share on other sites More sharing options...
dany Posted August 25, 2012 Share Posted August 25, 2012 (edited) You assume right. Basically you're treating the integer as if it was 64-bit and you shift it by 32. In this case you'll have to split the integer into two 32-bit values (high and low bit pair) and perform bitwise operation on the pair. I'm rather rusty in bitwise operations but some trail and error gave me this working script:Local $a = 51162856125 ; = 97 * 0x1F7047DD Local $aLow = BitAND($a / 4294967296, 0xFFFFFFFF) ; 4294967296 = 2^32, mask high bits. Local $aHigh = BitAND(Mod($a, 4294967296), 0x00000000) ; mask low bits. Local $b = BitShift($aLow, 32) + BitShift($aHigh, 32) ; shift MsgBox(0, '', $b) ; 11Your mileage may vary.[edit] I'm unaware of any UDF that deals with bitwise operators btw. [/edit] Edited August 25, 2012 by dany [center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF Link to comment Share on other sites More sharing options...
dany Posted August 25, 2012 Share Posted August 25, 2012 (edited) Glad it worked out. I also rolled a function out of it when I got a flashback. I've already seen a function called _BitShift64(), it's in Ward's Totally forgotten about it.[edit] Oops:Local $aLow = BitAND($a / 4294967296, 0xFFFFFFFF) ; 4294967296 = 2^32, mask high bits. <<<<<<<<< Actually $aHigh Local $aHigh = BitAND(Mod($a, 4294967296), 0x00000000) ; mask low bits.<<<<<<<<< Actually $aLow[/edit] Edited August 25, 2012 by dany [center]Spiderskank Spiderskank[/center]GetOpt Parse command line options UDF | AU3Text Program internationalization UDF | Identicon visual hash UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now