In lighthearted protest of the clickbait title: popcount: hamming weight of the argument, i.e. number of bits set.
popcount
This doesn’t seem very useful, right?
Me, in crypto: uh what this sounds amazing.
discusses its uses inside and outside cryptography
There it is :)
I originally came up with the clickbait title because a very early version of the !!Con CFP encouraged Upworthy-style submissions, and I stand by it. For every “this isn’t obscure at all!” there have been several “oh, I didn’t know that!” reactions.
Also still useful for comparing compressed document vectors obtained through random projection hashing.
However popcnt can be beaten for larger bitsets: http://0x80.pl/articles/sse-popcount.html
Worth mentioning that go’s wrapper for this (math/bits) has support for replacing the function call with an inlined instruction-based version in the latest version.
math/bits
In lighthearted protest of the clickbait title:
popcount
: hamming weight of the argument, i.e. number of bits set.Me, in crypto: uh what this sounds amazing.
There it is :)
I originally came up with the clickbait title because a very early version of the !!Con CFP encouraged Upworthy-style submissions, and I stand by it. For every “this isn’t obscure at all!” there have been several “oh, I didn’t know that!” reactions.
Also still useful for comparing compressed document vectors obtained through random projection hashing.
However popcnt can be beaten for larger bitsets: http://0x80.pl/articles/sse-popcount.html
Worth mentioning that go’s wrapper for this (
math/bits
) has support for replacing the function call with an inlined instruction-based version in the latest version.