News for hackers. Stuff that matters.
Re:Do binary files contain more 1s or 0s? by kazinator on Tuesday November 12, 2019 @03:51PM (#21518057)
There are at least two silly things in this code,

One is the hex conversion. Compare:

  >>> bin(int(binascii.hexlify(b"\x05"), 16))[2:]
  '101'
versus just:

  >>> bin(b"\x05"[0])[2:]
  '101'
Secondly, the code should just count the 1 bits; there is no need for a count of zeros.

There are no comments on this comment yet.