BB.Caching.Cache.Shared.Strings.CountSetBits C# (CSharp) Метод

CountSetBits() публичный статический Метод

Count the number of set bits (population counting) in a string.

By default all the bytes contained in the string are examined. It is possible to specify the counting operation only in an interval passing the additional arguments start and end.

Like for the GETRANGE command start and end can contain negative values in order to index bytes starting from the end of the string, where -1 is the last byte, -2 is the penultimate, and so forth.

http://redis.io/commands/bitcount
public static CountSetBits ( RedisKey key, long start, long end = -1 ) : long
key RedisKey /// The key. ///
start long /// The start. ///
end long /// The end. ///
Результат long
                public static long CountSetBits(RedisKey key, long start = 0, long end = -1)
                {
                    long result = SharedCache.Instance.GetWriteConnection(key)
                        .GetDatabase(SharedCache.Instance.Db)
                        .StringBitCount(key, start, end);

                    return result;
                }