| ... | @@ -270,7 +270,11 @@ pub fn validate_hash(input: []const u8, file_path: []const u8) !bool { | ... | @@ -270,7 +270,11 @@ pub fn validate_hash(input: []const u8, file_path: []const u8) !bool { |
| 270 | .sha256 => try do_hash(std.crypto.hash.sha2.Sha256, data), | 270 | .sha256 => try do_hash(std.crypto.hash.sha2.Sha256, data), |
| 271 | .sha512 => try do_hash(std.crypto.hash.sha2.Sha512, data), | 271 | .sha512 => try do_hash(std.crypto.hash.sha2.Sha512, data), |
| 272 | }; | 272 | }; |
| 273 | return std.mem.eql(u8, expected, actual); | 273 | const result = std.mem.eql(u8, expected, actual); |
| | 274 | if (!result) { |
| | 275 | std.log.info("expected: {s}, actual: {s}", .{expected, actual}); |
| | 276 | } |
| | 277 | return result; |
| 274 | } | 278 | } |
| 275 | | 279 | |
| 276 | pub fn do_hash(comptime algo: type, data: []const u8) ![]const u8 { | 280 | pub fn do_hash(comptime algo: type, data: []const u8) ![]const u8 { |