public class ZModem extends Object
Note by @antirez: this is actually the XMODEM CRC 16 algorithm, using the following parameters:
Name : "XMODEM", also known as "ZMODEM", "CRC-16/ACORN" Width : 16 bit Poly : 1021 (That is actually x^16 + x^12 + x^5 + 1) Initialization : 0000 Reflect Input byte : False Reflect Output CRC : False Xor constant to output CRC : 0000 Output for "123456789" : 31C3
| Constructor and Description |
|---|
ZModem() |
| Modifier and Type | Method and Description |
|---|---|
static int |
generate(Buffer buffer)
Convert a buffer into a redis slot hash.
|
static int |
generate(byte[] utf8)
Convert a string into a redis slot hash.
|
static int |
generate(String str)
Convert a string into a redis slot hash.
|
static int |
generateMulti(byte[]... keys)
Convert an array of multiple strings into a redis slot hash.
|
static int |
generateMulti(List<String> keys)
Convert an array of multiple strings into a redis slot hash.
|
public static int generate(String str)
str - stringpublic static int generate(byte[] utf8)
utf8 - bytespublic static int generate(Buffer buffer)
buffer - bufferpublic static int generateMulti(List<String> keys)
keys - list of keyspublic static int generateMulti(byte[]... keys)
keys - array of keysCopyright © 2020. All rights reserved.