aboutsummaryrefslogtreecommitdiffstats
path: root/src/crc16.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/crc16.zig')
-rw-r--r--src/crc16.zig4
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 @@
1const Error = error{InvalidChecksum}; 1pub const InvalidChecksumError = error{InvalidChecksum};
2 2
3const crc16tab: [256]u16 = tab: { 3const 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.
39pub fn validate(data: []const u8, expected: u16) !void { 39pub 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}