const std = @import("std"); const Allocator = std.mem.Allocator; pub fn hash(allocator: Allocator, data: []const u8) ![]u8 { const output_hash = try allocator.alloc(u8, std.crypto.hash.sha2.Sha256.digest_length); std.crypto.hash.sha2.Sha256.hash(data, @ptrCast(output_hash), .{}); return output_hash; }