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

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

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 CountSetBitsAsync ( RedisKey key, long start, long end = -1 ) : Task
key RedisKey /// The key. ///
start long /// The start. ///
end long /// The end. ///
Результат Task
                public static Task<long> CountSetBitsAsync(RedisKey key, long start = 0, long end = -1)
                {
                    Task<long> result = SharedCache.Instance.GetWriteConnection(key)
                        .GetDatabase(SharedCache.Instance.Db)
                        .StringBitCountAsync(key, start, end);

                    return result;
                }