function countBits(v) {
  /**
    * Computes the number of bits set in each group of 8bits then uses a
    * multiplication to sum all of them in the 8 most significant bits and
    * return these.
    * More detailed explanation can be found at
    * https://www.playingwithpointers.com/blog/swar.html
  */
   v = v - (((v) >> 1) & 0x55555555);
   v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
   return ((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}
countBits
Implemented from https://github.com/Bitcoin-ABC/bitcoin-abc/blob/f8cbc0e2b439aa4030430a7b1ecbdafede0dd072/src/util/bitmanip.h
@param {*} v