const std = @import("std"); const Allocator = std.mem.Allocator; const c = @cImport({ @cInclude("bdz.h"); }); pub fn search(packed_mphf: []const u8, key: []const u8) error{Overflow}!u32 { const bdz_start = @intToPtr(?*anyopaque, @ptrToInt(&packed_mphf[0])); const len = try std.math.cast(c_uint, key.len); return @as(u32, c.bdz_search_packed(bdz_start, key.ptr, len)); }