Celerity.Primitives
2.4.0
dotnet add package Celerity.Primitives --version 2.4.0
NuGet\Install-Package Celerity.Primitives -Version 2.4.0
<PackageReference Include="Celerity.Primitives" Version="2.4.0" />
<PackageVersion Include="Celerity.Primitives" Version="2.4.0" />
<PackageReference Include="Celerity.Primitives" />
paket add Celerity.Primitives --version 2.4.0
#r "nuget: Celerity.Primitives, 2.4.0"
#:package Celerity.Primitives@2.4.0
#addin nuget:?package=Celerity.Primitives&version=2.4.0
#tool nuget:?package=Celerity.Primitives&version=2.4.0
Celerity.Primitives
Low-level, allocation-free primitives that fill genuine BCL gaps. Part of the Celerity family of high-performance .NET libraries.
Every type here ships only because it beats its BCL counterpart on a documented
workload — Celerity deliberately does not reimplement what
System.Numerics.BitOperations / TensorPrimitives already inline.
What's in the box
FastUtils.FastMod/FastDiv— Lemire reciprocal modulo & division by a runtime-constant divisor; 2–4× over%//for repeated mod by the same divisor (hash buckets, ring buffers, sharding). The BCL's equivalent isinternal-only.FastUtils.CountDigits/Log10— exact integer base-10 digit count for buffer sizing and column alignment (the BCL's LZCNT-based one isinternal;Math.Log10mis-rounds at exact powers of ten).FastUtils.NextPowerOfTwo— rounds up to the next power of two.- Struct PRNGs — value-type, seed-deterministic
SplitMix64,Xoshiro256StarStar,Xoroshiro128Plus,WyRand,Pcg32, all implementing the one-methodIRandomSource, with a zero-costRandomSourceExtensionssurface (NextDouble/NextInt/NextBytes/…). No heap, no virtual dispatch, no legacy seeded fallback likeSystem.Random. VarInt— span-based LEB128 + zig-zagTry(Write|Read)overSpan<byte>, bounds-safe and allocation-free (the BCL's 7-bit codec is bound toBinaryReader/BinaryWriter).FastGuid/GuidV7Generator— fast non-crypto random GUID v4 and RFC 9562 big-endian v7 (sortable, DB-index-friendly). Not for security — useGuid.NewGuid()for unguessable IDs.
See the utilities API reference for full docs and runnable examples.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Celerity.Primitives:
| Package | Downloads |
|---|---|
|
Celerity.Collections
High-performance .NET dictionaries, sets, frozen/perfect-hash collections, and probabilistic sketches (Bloom, HyperLogLog, Count-Min) built on zero-cost struct hashers. As of the 2.0.0 split this package transitively pulls in Celerity.Hashing and Celerity.Primitives, so existing consumers keep working unchanged. |
|
|
Celerity.Hashing
Zero-cost struct hash providers and hash-quality tooling: IHashProvider<T>, integer/string/Guid hashers (identity, Wang, Murmur3, xxHash, SipHash, ...), DefaultHasher<T>, and the HashQualityEvaluator / ProbeStatisticsEvaluator offline analysis utilities. Positioned on distribution quality, determinism, and devirtualization — not on beating GetHashCode() for speed. Part of the Celerity family. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.4.0 | 0 | 7/26/2026 |
| 2.3.1-beta.15 | 0 | 7/25/2026 |
| 2.3.1-beta.8 | 38 | 7/23/2026 |
| 2.3.1-beta.2 | 45 | 7/22/2026 |
| 2.3.0 | 181 | 7/19/2026 |
| 2.2.1-beta.24 | 73 | 7/18/2026 |
| 2.2.1-beta.18 | 68 | 7/14/2026 |
| 2.2.1-beta.15 | 64 | 7/12/2026 |
| 2.2.1-beta.13 | 51 | 7/11/2026 |
| 2.2.1-beta.12 | 57 | 7/10/2026 |
| 2.2.1-beta.5 | 59 | 7/9/2026 |
| 2.2.1-beta.4 | 58 | 7/8/2026 |
| 2.2.1-beta.3 | 73 | 7/7/2026 |
| 2.2.1-beta.2 | 67 | 7/6/2026 |
| 2.2.0 | 130 | 7/5/2026 |
| 2.1.1-beta.4 | 52 | 7/4/2026 |
| 2.1.1-beta.2 | 73 | 7/2/2026 |
| 2.1.1-beta.1 | 62 | 7/1/2026 |
| 2.1.0 | 149 | 6/30/2026 |
| 2.0.1-beta.5 | 68 | 6/26/2026 |