1
1
Fork
You've already forked znow
0
A simple snowflake generator
  • Zig 100%
Adwaith-Rajesh 180efd45ec
[chore] Update the min version
bump the min version from 0.16.0-dev to 0.16.0
2026年05月16日 15:46:33 +05:30
src [LICENSE] 2026年03月31日 11:42:46 +05:30
.gitignore [dev] Hello World 2026年03月31日 10:39:29 +05:30
build.zig [dev] make it an importable module 2026年03月31日 11:32:12 +05:30
build.zig.zon [chore] Update the min version 2026年05月16日 15:46:33 +05:30
LICENSE [LICENSE] 2026年03月31日 11:42:46 +05:30
README.md [docs] Add README 2026年03月31日 11:53:55 +05:30

Znow

A simple snowflake generator.

Installation

# for dev
zig fetch --save git+https://codeberg.org/Adwaith-Rajesh/znow.git

you can also pick one of the archives from the releases


Usage

In build.zig

conststd=@import("std");pubfnbuild(b:*std.Build)void{...constznow=b.dependency("znow",.{});constexe=b.addExecutable(.{.name="test",.root_module=b.createModule(.{.root_source_file=b.path("..."),...,.imports=&.{.{.name="znow",.module=znow.module("znow"),},},}),});...}

Creating snowflakes

The below example create a 100 snowflakes

conststd=@import("std");constznow=@import("znow");pubfnmain(init:std.process.Init)!void{constio=init.io;varflake:znow.Snowflake(false)=.init(io,12);// use true for thread safe implementation// var flake: znow.Snowflake(true) = .init(io, 12);for(0..100)|_|{std.debug.print("flake -> {d}\n",.{tryflake.next()});}}

Have any Issues??

Please create a new issue, or join my Discord.


Byeeee..