Redis can directly perform bitwise operations on data.
# # # 2. Instance
- Setbit key offset value # Setbit key offset value # Setbit key offset value # Set hello to world
- Getbit key offset # Get the binary of the offset bit
- Bitcount key [start end] # Obtain the number of 1’s in the specified bitmap range
- bitop op destkey key [key…] # Do and(intersection), OR (union), NOT (not), xOR (xor) of multiple bitmaps and save the result in destkey
- Bitpos key targetBit [start] [end] # Calculate bitmap position from (start) to (end)
###1. What is Hyperloglog minimal space complete independent quantity statistics. The essence is a string. Ten million level storage consumes very little memory (a few MEgabytes) but has a high error rate (0.81%) ###2. Three commands
- pfadd key element [element… ] # Add elements to Hyperloglog
- pfcount key [key…] # Calculate the independent total of hyperloglog
- pfmerge destkey sourcekey [sourcekey…] # Merge multiple hyperloglog ###3. instances