authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-12-28 19:19:11 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-12-28 19:19:11 -08:00
log79462250252016b0e3128c3c10056b0e394a8253
tree2f5d2e73fc82a45c6bbc91d6ff174ebd26b24406
parentb31c8d68b8cdea7f047a7057dd1fe04ea1a8aed7

read in a bigger buffer for http deps


1 files changed, 2 insertions(+), 1 deletions(-)

src/util/funcs.zig+2-1
...@@ -10,6 +10,7 @@ const u = @import("index.zig");...@@ -10,6 +10,7 @@ const u = @import("index.zig");
10pub const b = 1;10pub const b = 1;
11pub const kb = b * 1024;11pub const kb = b * 1024;
12pub const mb = kb * 1024;12pub const mb = kb * 1024;
13pub const gb = mb * 1024;
1314
14pub fn print(comptime fmt: []const u8, args: anytype) void {15pub fn print(comptime fmt: []const u8, args: anytype) void {
15 std.debug.print(fmt++"\n", args);16 std.debug.print(fmt++"\n", args);
...@@ -263,7 +264,7 @@ pub fn validate_hash(input: []const u8, file_path: []const u8) !bool {...@@ -263,7 +264,7 @@ pub fn validate_hash(input: []const u8, file_path: []const u8) !bool {
263 const hash = parse_split(HashFn, "-").do(input) catch return false;264 const hash = parse_split(HashFn, "-").do(input) catch return false;
264 const file = try std.fs.cwd().openFile(file_path, .{});265 const file = try std.fs.cwd().openFile(file_path, .{});
265 defer file.close();266 defer file.close();
266 const data = try file.reader().readAllAlloc(gpa, mb);267 const data = try file.reader().readAllAlloc(gpa, gb);
267 return std.mem.eql(u8, hash.string, switch (hash.id) {268 return std.mem.eql(u8, hash.string, switch (hash.id) {
268 .blake3 => blk: {269 .blake3 => blk: {
269 const h = &std.crypto.hash.Blake3.init(.{});270 const h = &std.crypto.hash.Blake3.init(.{});