diff options
| author | Rutger Broekhoff | 2021-05-26 20:08:01 +0200 |
|---|---|---|
| committer | Rutger Broekhoff | 2021-05-26 20:08:01 +0200 |
| commit | 0a69d6de4556cc43a56b94ea7f95c64b73560eae (patch) | |
| tree | 458d4d4ae70a38466623d3b4e133be47f424a8f4 /src | |
| parent | 1956639e8a5f4f120c2600544ca579c834f08f29 (diff) | |
| download | zig-nkeys-0a69d6de4556cc43a56b94ea7f95c64b73560eae.tar.gz zig-nkeys-0a69d6de4556cc43a56b94ea7f95c64b73560eae.zip | |
Consistent spelling of CRC-16
Diffstat (limited to 'src')
| -rw-r--r-- | src/crc16.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crc16.zig b/src/crc16.zig index b69dcbc..3ea5a15 100644 --- a/src/crc16.zig +++ b/src/crc16.zig | |||
| @@ -30,12 +30,12 @@ pub fn update(crc: u16, with_data: []const u8) u16 { | |||
| 30 | return new_crc; | 30 | return new_crc; |
| 31 | } | 31 | } |
| 32 | 32 | ||
| 33 | // make returns the CRC16 checksum for the data provided. | 33 | // make returns the CRC-16 checksum for the data provided. |
| 34 | pub fn make(data: []const u8) u16 { | 34 | pub fn make(data: []const u8) u16 { |
| 35 | return update(0, data); | 35 | return update(0, data); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | // validate will check the calculated CRC16 checksum for data against the expected. | 38 | // validate will check the calculated CRC-16 checksum for data against the expected. |
| 39 | pub fn validate(data: []const u8, expected: u16) InvalidChecksumError!void { | 39 | pub fn validate(data: []const u8, expected: u16) InvalidChecksumError!void { |
| 40 | if (make(data) != expected) return error.InvalidChecksum; | 40 | if (make(data) != expected) return error.InvalidChecksum; |
| 41 | } | 41 | } |