redis.clients.util
Class JedisClusterCRC16
java.lang.Object
redis.clients.util.JedisClusterCRC16
public class JedisClusterCRC16
- extends Object
CRC16 Implementation according to CCITT standard
Polynomial : 1021 (x^16 + x^12 + x^5 + 1)
- See Also:
Appendix A. CRC16 reference implementation in ANSI C
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JedisClusterCRC16
public JedisClusterCRC16()
getSlot
public static int getSlot(String key)
getCRC16
public static int getCRC16(byte[] bytes)
- Create a CRC16 checksum from the bytes.
implementation is from mp911de/lettuce, modified with some more optimizations
- Parameters:
bytes
-
- Returns:
- CRC16 as integer value
- See Also:
https://github.com/xetorthio/jedis/pull/733#issuecomment-55840331
getCRC16
public static int getCRC16(String key)
Copyright © 2014. All rights reserved.