diff options
Diffstat (limited to 'src/crc16.zig')
-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 b00c795..2c49500 100644 --- a/src/crc16.zig +++ b/src/crc16.zig | |||
@@ -1,4 +1,4 @@ | |||
1 | const Error = error{InvalidChecksum}; | 1 | pub const InvalidChecksumError = error{InvalidChecksum}; |
2 | 2 | ||
3 | const crc16tab: [256]u16 = tab: { | 3 | const crc16tab: [256]u16 = tab: { |
4 | @setEvalBranchQuota(10000); | 4 | @setEvalBranchQuota(10000); |
@@ -36,6 +36,6 @@ pub fn make(data: []const u8) u16 { | |||
36 | } | 36 | } |
37 | 37 | ||
38 | // validate will check the calculated CRC16 checksum for data against the expected. | 38 | // validate will check the calculated CRC16 checksum for data against the expected. |
39 | pub fn validate(data: []const u8, expected: u16) !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 | } |