{"id":14990819,"url":"https://github.com/hun756/zigonic","last_synced_at":"2026-02-11T08:05:17.423Z","repository":{"id":204684711,"uuid":"712115827","full_name":"hun756/zigonic","owner":"hun756","description":"Algorithm library in Zig programming language","archived":false,"fork":false,"pushed_at":"2026-01-15T22:46:01.000Z","size":117,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-16T01:50:33.038Z","etag":null,"topics":["algorithm","algorithms","zig","zig-lang","zig-library","ziglang"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hun756.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-30T20:26:13.000Z","updated_at":"2026-01-15T22:46:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"6f1d5837-0e4e-4635-b274-305b4eb92a81","html_url":"https://github.com/hun756/zigonic","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":0.08333333333333337,"last_synced_commit":"0c9b3f68e7797b3518507f8e07c2e643fc7cf906"},"previous_names":["hun756/zigonic"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hun756/zigonic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hun756%2Fzigonic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hun756%2Fzigonic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hun756%2Fzigonic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hun756%2Fzigonic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hun756","download_url":"https://codeload.github.com/hun756/zigonic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hun756%2Fzigonic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29329580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","algorithms","zig","zig-lang","zig-library","ziglang"],"created_at":"2024-09-24T14:20:54.548Z","updated_at":"2026-02-11T08:05:17.417Z","avatar_url":"https://github.com/hun756.png","language":"Zig","readme":"# Zigonic\n\n**Zigonic** is a comprehensive, production-ready algorithm library for Zig, featuring highly optimized implementations of algorithms and data structures from multiple programming paradigms.\n\n## 🚀 Features\n\n### Core Algorithm Categories\n- **STL-style Algorithms** (~95% C++ STL coverage)\n  - Predicates, searching, sorting, transforming\n  - Set operations, heap operations, permutations\n  - Modifying \u0026 non-modifying sequence operations\n  \n- **Parallel Algorithms**\n  - Thread-pool based parallel execution\n  - Parallel sorting, searching, reduction operations\n  - Fine-grained control over parallelism\n\n### Advanced Modules\n\n#### 📐 Math \u0026 Number Theory\n- GCD, LCM (Euclidean \u0026 Binary algorithms)\n- Prime operations (Miller-Rabin, Sieve of Eratosthenes)\n- Modular arithmetic (modPow, modInverse, Chinese Remainder)\n- Number theory functions (Euler's totient, Möbius function)\n- Combinatorics (Fibonacci, binomial, Catalan numbers)\n\n#### 🌐 Graph Algorithms\n- BFS, DFS traversals\n- Shortest path (Dijkstra, Bellman-Ford)\n- Topological sort, cycle detection\n- Strongly connected components (Kosaraju)\n- Minimum spanning tree (Prim's algorithm)\n\n#### 📊 Data Structures\n- **UnionFind** (Disjoint Set Union with path compression)\n- **BloomFilter** (Space-efficient probabilistic set membership)\n- **LRU Cache** (O(1) get/put operations)\n- **Skip List** (O(log n) average operations)\n- **Trie** (Prefix tree for string operations)\n\n#### 🗜️ Compression Algorithms\n- Run-Length Encoding (RLE)\n- Delta encoding/decoding\n- Variable-Length Quantity (VLQ)\n- LZ77 compression\n- Burrows-Wheeler Transform (BWT)\n- Move-to-Front Transform (MTF)\n\n#### 💾 Memory Utilities\n- **Ring Buffer** (Lock-free circular buffer)\n- **Object Pool** (Reusable object allocation)\n- **Slab Allocator** (Fixed-size block allocation)\n- **Bump Allocator** (Ultra-fast linear allocation)\n- **Deque** (Double-ended queue)\n\n#### ⏱️ Interval Algorithms\n- Interval operations (merge, overlap, intersection)\n- Interval Tree (O(log n) queries)\n- Maximum non-overlapping intervals\n- Minimum meeting rooms (interval partitioning)\n\n#### ⚡ SIMD Optimizations\n- SIMD-optimized sum, min, max\n- SIMD dot product\n- SIMD element-wise operations\n- Cache-friendly block transpose\n\n#### 🔤 String Algorithms\n- Pattern matching (KMP, Boyer-Moore, Rabin-Karp)\n- Edit distance (Levenshtein, Hamming)\n- Longest common substring/subsequence\n- String utilities (trim, split, join)\n\n#### 🔢 Bitwise Operations\n- Bit counting (popcount, clz, ctz)\n- Bit manipulation (set, clear, toggle, extract)\n- Power operations (isPowerOfTwo, nextPowerOfTwo)\n- Rotation, reversal, Gray code\n\n#### 🔐 Hashing \u0026 Checksums\n- Hash functions (FNV-1a, DJB2, MurmurHash3, xxHash32)\n- Checksums (CRC32, CRC16, Adler32, Fletcher)\n- Utilities (hashCombine, hashSlice)\n\n#### 🎯 Functional Programming\n- Function composition (compose, pipe)\n- Higher-order functions (zipWith, scanLeft/Right)\n- List operations (takeWhile, dropWhile, chunks, windows)\n- Transformations (flatten, transpose, groupBy)\n\n## 📦 Installation\n\nAdd to your `build.zig.zon`:\n\n```zig\n.{\n    .name = \"your-project\",\n    .version = \"0.1.0\",\n    .dependencies = .{\n        .zigonic = .{\n            .url = \"https://github.com/hun756/zigonic/archive/\u003ccommit-hash\u003e.tar.gz\",\n        },\n    },\n}\n```\n\n## 🔧 Usage Examples\n\n### Basic Algorithms\n```zig\nconst zigonic = @import(\"zigonic\");\n\n// Searching\nconst arr = [_]i32{ 1, 2, 3, 4, 5 };\nconst result = zigonic.binarySearch(i32, \u0026arr, 3);\n\n// Sorting\nvar data = [_]i32{ 5, 2, 8, 1, 9 };\nzigonic.sort(i32, \u0026data);\n\n// Accumulation\nconst sum = zigonic.sum(i32, \u0026arr);\n```\n\n### Math \u0026 Number Theory\n```zig\n// Prime checking (Miller-Rabin)\nconst is_prime = zigonic.isPrime(104729);\n\n// GCD \u0026 LCM\nconst g = zigonic.gcd(u32, 48, 18);\nconst l = zigonic.lcm(u32, 12, 18);\n\n// Modular arithmetic\nconst result = zigonic.modPow(4, 13, 497);\n\n// Fibonacci (O(log n))\nconst fib = zigonic.fibonacci(50);\n```\n\n### Graph Algorithms\n```zig\nconst allocator = std.heap.page_allocator;\nvar graph = try zigonic.AdjacencyList(u32).init(allocator, 5);\ndefer graph.deinit();\n\ntry graph.addEdge(0, 1, 10);\ntry graph.addEdge(1, 2, 5);\n\nconst result = try zigonic.dijkstra(u32, \u0026graph, 0, allocator);\ndefer allocator.free(result.distances);\ndefer allocator.free(result.parents);\n```\n\n### Data Structures\n```zig\n// LRU Cache\nvar cache = zigonic.LRUCache(u32, []const u8).init(allocator, 100);\ndefer cache.deinit();\n\ntry cache.put(1, \"value1\");\nconst value = cache.get(1);\n\n// Bloom Filter\nvar bloom = try zigonic.BloomFilter(5).init(allocator, 1000, 0.01);\ndefer bloom.deinit();\n\nbloom.add(\"hello\");\nconst might_contain = bloom.mightContain(\"hello\");\n```\n\n### SIMD Operations\n```zig\nvar data = [_]f32{ 1.0, 2.0, 3.0, 4.0 };\nconst sum = zigonic.simdSum(f32, \u0026data);\nconst min = zigonic.simdMin(f32, \u0026data);\nconst max = zigonic.simdMax(f32, \u0026data);\n```\n\n### Compression\n```zig\nconst original = \"AAABBBCCCC\";\nconst encoded = try zigonic.rleEncode(allocator, original);\ndefer allocator.free(encoded);\n\nconst decoded = try zigonic.rleDecode(allocator, encoded);\ndefer allocator.free(decoded);\n```\n\n## 🎯 Performance\n\nZigonic is designed with performance as a top priority:\n- **SIMD optimizations** for numerical operations\n- **Cache-friendly** algorithms and data structures\n- **Lock-free** implementations where applicable\n- **Zero-cost abstractions** leveraging Zig's compile-time features\n- **Minimal allocations** with careful memory management\n\n## 📊 Test Coverage\n\n**273+ passing tests** covering all major modules and algorithms.\n\n## 🛠️ Requirements\n\n- Zig 0.14.1 or newer\n\n## 📖 Documentation\n\nSee [API Documentation](docs/api.md) for detailed API reference.\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🙏 Acknowledgments\n\nInspired by algorithms from:\n- C++ STL\n- Rust standard library\n- Python standard library\n- Haskell Prelude\n- Various computer science textbooks and papers\n\n---\n\n**Note**: Some advanced features (BWT, ObjectPool) are under active development and may have known limitations.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhun756%2Fzigonic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhun756%2Fzigonic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhun756%2Fzigonic/lists"}