Is it possible to do an unsigned bit shift in Unity’s implementation of JS? I am trying to incorporate some JavaScript that uses the “>>>” symbol and it doesn’t seem to like it.
Alternatively, if anyone happens to know of an implementation of SHA512 that works, that would be even better, but I may put that in another thread to avoid digression.
Thanks very much.
Cast to an unsigned type, shift, and then cast back. (Or just use unsigned in the first place, maybe?)
–Eric
Great - thanks very much Eric.
Do you happen to know how to do an XOR(^) with Unity’s JS? I think that’s the only other part of the algorithm that won’t compile.
I’d like to keep it JS if possible (rather than C#) since reprogramming this bitwise stuff without bugs will likely cause me to lose what little sanity I have left 
License permitting, I will post this stuff up when I get it working.
XOR is a trivial operation.
XOR =( A !B ) || ( !A B) for boolean or
XOR = ( A !B ) | (!A B) for bitwise
Brilliant! Thanks guys.
I’ll be working with this for some time longer but will hopefully post up the algorithm later.
Just wanted to cross reference dreamora’s related answer to the XOR question here (which I actually had in a search result waiting to be read, doh!):
http://forum.unity3d.com/viewtopic.php?t=37001