Skip to content

Releases: bmorphism/open-location-code-zig

v1.1.0

30 Dec 19:33

Choose a tag to compare

What's New

  • shorten(): Shorten full codes relative to a reference location
  • recover(): Recover full codes from short codes using a reference
  • Improved documentation with module-level docs and section headers
  • 35 comprehensive tests (up from 30)

API Additions

// Shorten a full code when near a reference point
const len = try olc.shorten("849VQHFJ+X6", 37.775, -122.419, &buffer);
// Result: "QHFJ+X6" (shortened)

// Recover full code from short code
const len = try olc.recover("QHFJ+X6", 37.775, -122.419, &buffer);
// Result: "849VQHFJ+X6" (full code)

Installation

Update your build.zig.zon:

.open_location_code = .{
    .url = "https://github.com/bmorphism/open-location-code-zig/archive/refs/tags/v1.1.0.tar.gz",
    .hash = "...", // run zig fetch to get hash
},