Zig
Zig
Example: Http.DownloadHash method
Demonstrates theDownloadHash method.
Chilkat Zig Downloads
const std = @import("std");
const chilkat = @import("chilkat");
pub fn main(init: std.process.Init) !void {
const alloc = init.arena.allocator();
const http = try chilkat.Http.init();
defer http.deinit();
const url = "https://chilkatdownload.com/11.1.0/chilkat2-python-3.13-x64.zip";
const encoded_hash = http.downloadHash(alloc, url, "sha256", "hex_lower") catch {
std.debug.print("{s}\n", .{try http.getLastErrorText(alloc)});
return;
};
// Expected value: 32583182374888c7761e7c15b998fd1d326c439c704d59380d34599f4be9b63a
std.debug.print("sha256 = {s}\n", .{encoded_hash});
}