Package redis.clients.jedis.util
Class JedisClusterCRC16
- java.lang.Object
-
- redis.clients.jedis.util.JedisClusterCRC16
-
public final class JedisClusterCRC16 extends Object
CRC16 Implementation according to CCITT standard Polynomial : 1021 (x^16 + x^12 + x^5 + 1) See Appendix A. CRC16 reference implementation in ANSI C
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetCRC16(byte[] bytes)static intgetCRC16(byte[] bytes, int s, int e)Create a CRC16 checksum from the bytes.static intgetCRC16(String key)static intgetSlot(byte[] key)static intgetSlot(String key)
-
-
-
Method Detail
-
getSlot
public static int getSlot(String key)
-
getSlot
public static int getSlot(byte[] key)
-
getCRC16
public static int getCRC16(byte[] bytes, int s, int e)Create a CRC16 checksum from the bytes. implementation is from mp911de/lettuce, modified with some more optimizations- Parameters:
bytes-s-e-- Returns:
- CRC16 as integer value See Issue 733
-
getCRC16
public static int getCRC16(byte[] bytes)
-
getCRC16
public static int getCRC16(String key)
-
-