bitcount key [start] [end]

Count the number of set bits (population counting) in a string. Like Redis's bitcount.

Parameters

Return Value

The number of bits set to 1.

Example

ssdb 127.0.0.1:8888> set a 123
ok
(0.000 sec)
ssdb 127.0.0.1:8888> countbit a 0 1
3
(0.000 sec)
ssdb 127.0.0.1:8888> bitcount a 0 1
6
(0.000 sec)
ssdb 127.0.0.1:8888>