Method: Redis#bitcount

Defined in:
lib/redis.rb

#bitcount(key, start = 0, stop = -1)) ⇒ Fixnum

Count the number of set bits in a range of the string value stored at key.

Parameters:

  • key (String)
  • start (Fixnum) (defaults to: 0)

    start index

  • stop (Fixnum) (defaults to: -1))

    stop index

Returns:

  • (Fixnum)

    the number of bits set to 1



891
892
893
894
895
# File 'lib/redis.rb', line 891

def bitcount(key, start = 0, stop = -1)
  synchronize do |client|
    client.call([:bitcount, key, start, stop])
  end
end