jedisct1

djbsort: fast, data-oblivious sorting algorithm.

14
0
100% credibility
Found Feb 18, 2026 at 11 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Zig
AI Summary

A secure sorting tool for the Zig language that arranges lists without timing leaks, ideal for sensitive data.

How It Works

1
🔍 Discover secure sorter

You learn about a special sorter that organizes lists of numbers or items super fast without revealing any secrets about the data.

2
📥 Add to your work

You bring this sorter into your own project with a simple setup.

3
Pick your list type
🔢
Numbers

For everyday numbers like scores or measurements.

🏷️
Custom items

For special things like points or records with your own rules.

4
Sort the list

You give your list to the sorter, picking up or down order, and it arranges everything privately and quickly.

5
📊 Test the speed

You run checks and see how much faster it works than regular sorters.

Perfect and safe

Your list is neatly organized, lightning fast, and completely secure from any sneaky timing tricks.

Sign up to see the full architecture

4 more

Sign Up Free

Star Growth

See how this repo grew from 11 to 14 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is zig-djbsort?

zig-djbsort brings DJB's djbsort to Zig: a fast, data-oblivious sorting algorithm where comparisons and swaps follow a fixed pattern based solely on array size, dodging timing attacks on sensitive data. You get two drop-in functions mimicking Zig's std.sort.pdq—one for native integers and floats with SIMD speedups, another for any type via custom comparators. It's built for crypto contexts or anywhere predictable performance trumps adaptive sorts.

Why is it gaining traction?

Unlike std.sort.pdq, the SIMD path crushes it on small-to-medium arrays (4-9x faster up to 16K elements on Zen4, 2-5x on Apple Silicon), while staying 1.3-1.5x ahead at 1M. The generic version beats pdq up to 65K elements too, and everything runs constant-time if your comparator does—perfect for side-channel paranoia. Benchmarks are baked in via zig build bench, so you verify gains yourself.

Who should use this?

Crypto engineers sorting keys or nonces without leak risks. Embedded devs needing bounded-time sorts for real-time systems. Zig library authors optimizing numeric pipelines where arrays top out under 100K.

Verdict

Grab it for niche speed and security wins if you're in Zig and match the perf profile—solid tests and docs punch above 10 stars. At 1.0% credibility, treat as experimental; run your own benchmarks before prod.

(178 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.