<patrick@patric k-isp.comwrote:
<snip>
My main problem at this time is this little part of code.
>
var nonce = (new Date()).getTime ();
for (var i=0; i<4; i++) {
counterBlock[i] = (nonce >>i*8) & 0xff;
}
>
I have absolutely no idea what the >>means as i have been
unable to find anything on this.
>
var nonce = (new Date()).getTime ();
for (var i=0; i<4; i++) {
counterBlock[i] = (nonce >>i*8) & 0xff;
}
>
I have absolutely no idea what the >>means as i have been
unable to find anything on this.
Ed. Section 11.7.3). The left hand side operand is converted into an
unsigned 32 bit integer and shifted right by the number of bits
specified by the right hand side operand (the result of the expression -
i*8 - in this case). The result is then converted back to a normal
javascript number (an IEEE double precision floating point number) and
that number is the evaluated result of the unsigned right shift
expression.
Incidentally, the - & - is the bidwise AND operator, so the effect is to
mask out all but the lower (right-most) byte of the shifted number.
This code is JavaScript.
I know i am new to this group but, if i am at the wrong place
to ask for help, just move or delete my post.
to ask for help, just move or delete my post.
P.S. i know i am asking a lot but, if someone has an
idea how i can reproduce this under PHP, i would
greatly appreciate.
idea how i can reproduce this under PHP, i would
greatly appreciate.
looking (either PHP has an equivalent operator or it does not, but if
not the same effect could be achieved with other math operators), but
not right now.
Richard.
Leave a comment: