-
Notifications
You must be signed in to change notification settings - Fork 5
Cheat Sheet
The cheat sheet covers both the Command Line Interface (CLI) and the Java API (Application Programming Interface).
jacksum --info
or
jacksum -a all --list
Map<String, String> availableAlgorithms = JacksumAPI.getAvailableAlgorithms();
jacksum --version
JacksumAPI.VERSION;
or
Version version = JacksumAPI.getVersion();
or
String versionString = JacksumAPI.getVersionString();
jacksum -a unknown:16 -q hex:050000 -E hex -e d893
Finds all algorithms with a digest width of 16 bits that produces the hex output d893 for the hex input 050000.
Result
Trying 13 algorithms with a width of 16 bits that are supported by Jacksum 3.0.0 ...
Trying 30 CRC algorithms with a width of 16 bits by testing against well known CRCs ...
crc:16,1021,FFFF,false,false,FFFF
--> CRC-16/GENIBUS
Trying all CRC algorithms with a width of 16 bits by brute force (be patient!) ...
crc:16,1021,FFFF,false,false,FFFF
crc:16,37D2,FFFF,true,false,FFFF
crc:16,3E2D,0000,true,false,FFFF
crc:16,4175,FFFF,true,false,FFFF
crc:16,4A5B,FFFF,true,true,0000
crc:16,5A41,FFFF,true,false,FFFF
crc:16,5C63,FFFF,true,true,0000
crc:16,6287,FFFF,true,true,0000
crc:16,649C,0000,false,true,FFFF
crc:16,6D55,FFFF,true,true,0000
crc:16,75AC,FFFF,true,false,FFFF
crc:16,7D64,FFFF,false,false,FFFF
crc:16,81A6,FFFF,true,false,FFFF
crc:16,B9F9,FFFF,true,true,0000
crc:16,C3D6,FFFF,false,false,FFFF
crc:16,D436,0000,true,false,FFFF
crc:16,D6D2,0000,false,true,FFFF
crc:16,DA9C,FFFF,true,false,FFFF
crc:16,E03E,FFFF,false,false,FFFF
crc:16,F701,FFFF,true,false,FFFF
Jacksum: algorithms tested: 1048620
Jacksum: algorithms found: 21
Jacksum: elapsed time: 6 s, 460 ms
Means Jacksum has tested more than one million algorithms in about 7 seconds and it found 21 matching algorithms. Each of those returns the same CRC. Test with more input/output sequences or longer sequences in order to find the right algorithm. The most likely algorithm is printed with a name, if it is a well known CRC. In this case it has been identified as CRC-16/GENIBUS.
Once you have identified the correct algorithm, you can calculate your own input data using the CRC definitions that have been found.
jacksum -a crc:16,1021,FFFF,false,false,FFFF -E hex -q txt:"Hello World"
Jacksum • https://jacksum.net • Jacksum on GitHub