javascript - whats the meaning of this condition if (buffer[0] & 0x80) -
i came across code below , trying understand meaning of condition if (buffer[0] & 0x80)
biginteger.frombuffer = function (buffer) { if (buffer[0] & 0x80) { var bytearray = array.prototype.slice.call(buffer) return new biginteger([0].concat(bytearray)) } return new biginteger(buffer) }
this bitwise and-operator. and-operation on each bit position of these 2 integers , returns new integer.
as example:
10010001 10000000
that be:
10000000
Comments
Post a Comment