Data partitioningRedis clusters store data on multiple nodes, that is, different partitions are stored on different nodes, and each node can store multiple partitions. Each partition is also referred to as a "hash slot" in Redis, with a total of 16,3
How the PHP CRC16 check code algorithm is used
Recently used in the CRC16,
I am now going to calculate the 010301180001 CRC16 check code, through other tools, you can get the check code is 05F1
The final complete code is
01030118000105f1
I now
Cyclic redundancy code Check English name is cyclical redundancy check, referred to as CRC. It uses the principle of division and remainder to make false detection (error detecting). In practical application, the transmitting device calculates the
CRC16 common standards are used in various specifications, the principle of its algorithm is basically consistent, that is, in the data input and output differences, below the standards of the differences listed, and give the C language algorithm
[Java] View Plain copy package org.rui.hi; /** * test: Solution scenario: 100 million of users stored in a queue, too large. redis cluster sharding Redis * with sharding The cluster uses data fragmentation (sharding) rather
'Data is the starting point of the struct array 'start'. The size is a few, and the returned value is CRC.Public Function CRC16 (Data () As Byte, start As Integer, size As Integer) As LongDim CRC16Lo As Byte, CRC16Hi As Byte 'crc registerDim CL As
Algorithm:
Public Ushort [] Crc16table = { 0x0 , Zero X 1021 , Zero X 2042 , Zero X 3063 , Zero X 4084 , 0x50a5 , 0x60c6 , 0x70e7 , Zero X 8108 ,Zero X 9129 , 0xa14a , 0xb16b , 0xc18c , 0xd1ad , 0xe1ce , 0xf1ef , Zero X 1231 , Zero x 210 ,
Redis3.0 cluster CRC16 algorithm PHP client Implementation method (PHP obtains the Redis partition slot of Redis data in the redis3.0 cluster and obtains the Redis server address of the partition based on the partition slot)
Data
The CRC checksum can be used to validate the data during transmission, when sending valid data, the CRC check code is computed according to the valid data and generating polynomial (such as CCITT Standard polynomial is x16+x12+x5+1), and the CRC
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.