tensorush / zig-quickphf

🗺️ Zig port of the QuickPhf minimal perfect hash function for generating static hash maps created by @dtrifuno.

Home Page:https://tensorush.github.io/zig-quickphf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🦎 🗺️ zig quickphf

CI CD DC CC LC

Zig port of the QuickPhf library created by Darko Trifunovski.

🚀 Usage

  1. Add quickphf as a dependency in your build.zig.zon.

    build.zig.zon example
    .{
        .name = "<name_of_your_package>",
        .version = "<version_of_your_package>",
        .dependencies = .{
            .quickphf = .{
                .url = "https://github.com/tensorush/quickphf/archive/<git_tag_or_commit_hash>.tar.gz",
                .hash = "<package_hash>",
            },
        },
        .paths = .{
            "src/",
            "build.zig",
            "README.md",
            "LICENSE.md",
            "build.zig.zon",
        },
    }

    Set <package_hash> to 12200000000000000000000000000000000000000000000000000000000000000000 and build your package to find the correct value specified in a compiler error message.

  2. Add quickphf as a module in your build.zig.

    build.zig example
    const quickphf = b.dependency("quickphf", .{});
    lib.root_module.addImport("quickphf", quickphf.module("quickphf"));

About

🗺️ Zig port of the QuickPhf minimal perfect hash function for generating static hash maps created by @dtrifuno.

https://tensorush.github.io/zig-quickphf/

License:MIT License


Languages

Language:Zig 100.0%