add new operation CRC-16-CCITT Checksum

This commit is contained in:
MikeCAT 2022-11-03 08:15:22 +09:00
parent ed8bd34915
commit 60ea87c1ad
5 changed files with 110 additions and 0 deletions

View file

@ -194,6 +194,50 @@ TestRegister.addTests([
}
]
},
{
name: "CRC-16-CCITT: nothing",
input: "",
expectedOutput: "0000",
recipeConfig: [
{
"op": "CRC-16-CCITT Checksum",
"args": []
}
]
},
{
name: "CRC-16-CCITT: basic string",
input: BASIC_STRING,
expectedOutput: "03ef",
recipeConfig: [
{
"op": "CRC-16-CCITT Checksum",
"args": []
}
]
},
{
name: "CRC-16-CCITT: UTF-8",
input: UTF8_STR,
expectedOutput: "cf94",
recipeConfig: [
{
"op": "CRC-16-CCITT Checksum",
"args": []
}
]
},
{
name: "CRC-16-CCITT: all bytes",
input: ALL_BYTES,
expectedOutput: "7e55",
recipeConfig: [
{
"op": "CRC-16-CCITT Checksum",
"args": []
}
]
},
{
name: "CRC-32: nothing",
input: "",

View file

@ -63,6 +63,7 @@ Fletcher-64: 00000459000001c0
Adler-32: 045d01c1
CRC-8: b9
CRC-16: f82e
CRC-16-CCITT: 9b06
CRC-32: d87f7e0c
`,
recipeConfig: [