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 

https://en.wikipedia.org/wiki/bitwise_operation#and


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

.htaccess - ERR_TOO_MANY_REDIRECTS htaccess -