RFC 9562 UUID implementation in Zig sites.wisp.place/jcollie.dev/uuid.zig/
zig uuid
1

Configure Feed

Select the types of activity you want to include in your feed.

Zig 98.0%
Nix 2.0%
49 1 0

Clone this repository

https://tangled.org/jcollie.dev/uuid.zig https://tangled.org/did:plc:phmpeygcwptffpva2rvc7j5t
git@knot.jcollie.dev:jcollie.dev/uuid.zig git@knot.jcollie.dev:did:plc:phmpeygcwptffpva2rvc7j5t

For self-hosted knots, clone URLs may differ based on your setup.



README.md

RFC 9562 UUIDs for Zig#

Example#

const std = @import("std");
const UUID = @import("uuid").UUID;

pub fn main(init: std.process.Init) void {
    const rng_impl: std.Random.IoSource = .{ .io = init.io };
    const rng = rng_impl.interface();

    const uuid: UUID = .new(.{
        .v4 = .{
            .rng = rng,
        },
    });

    std.debug.print("{s}\n", .{uuid.serialize()});
}