Soenneker.Extensions.Spans.Chars
11.0.63
Prefix Reserved
dotnet add package Soenneker.Extensions.Spans.Chars --version 11.0.63
NuGet\Install-Package Soenneker.Extensions.Spans.Chars -Version 11.0.63
<PackageReference Include="Soenneker.Extensions.Spans.Chars" Version="11.0.63" />
<PackageVersion Include="Soenneker.Extensions.Spans.Chars" Version="11.0.63" />
<PackageReference Include="Soenneker.Extensions.Spans.Chars" />
paket add Soenneker.Extensions.Spans.Chars --version 11.0.63
#r "nuget: Soenneker.Extensions.Spans.Chars, 11.0.63"
#:package Soenneker.Extensions.Spans.Chars@11.0.63
#addin nuget:?package=Soenneker.Extensions.Spans.Chars&version=11.0.63
#tool nuget:?package=Soenneker.Extensions.Spans.Chars&version=11.0.63
Soenneker.Extensions.Spans.Chars
Allocation-free helpers for clearing character buffers and writing pre-sized long values.
Installation
dotnet add package Soenneker.Extensions.Spans.Chars
Clear sensitive characters
using Soenneker.Extensions.Spans.Chars;
Span<char> password = stackalloc char[64];
// Fill and use password...
password.SecureZero();
SecureZero() clears the bytes backing the entire span through CryptographicOperations.ZeroMemory, so the write cannot be optimized away. It mutates only the supplied span; copies of the secret remain the caller's responsibility.
Write an integer into a prepared buffer
using Soenneker.Extensions.Spans.Chars;
const long value = -12345;
Span<char> buffer = stackalloc char[6];
buffer.WriteInt64(value, digits: 6);
string text = new(buffer); // "-12345"
WriteInt64() and WritePositiveInt64() are low-level formatting helpers for code that already knows the exact output length. They avoid allocations, but intentionally do not calculate or validate digits.
WriteInt64()accepts the fulllongrange.digitsincludes the minus sign.WritePositiveInt64()requires a non-negative value.digitsis the number of decimal digits.- The destination must contain at least
digitscharacters. - An incorrect digit count can leave characters unwritten or cause indexing to fail. Use
long.TryFormat()when the output length is not already known.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Extensions.Spans.Bytes (>= 11.0.37)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Soenneker.Extensions.Spans.Chars:
| Package | Downloads |
|---|---|
|
Soenneker.Utils.Password
A modern .NET secure password generator |
|
|
Soenneker.Blazor.Utils.Ids
A lightweight ID generator for consistent identity across the UI for Blazor components. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.63 | 3,378 | 11/11/2026 |
| 11.0.62 | 563 | 11/11/2026 |
| 11.0.61 | 1,663 | 11/10/2026 |
| 11.0.60 | 67 | 11/10/2026 |
| 11.0.59 | 100 | 11/10/2026 |
| 4.0.57 | 25,537 | 10/15/2026 |
| 4.0.56 | 133 | 10/14/2026 |
| 4.0.55 | 281 | 10/14/2026 |
| 4.0.54 | 133 | 10/14/2026 |
| 4.0.48 | 2,016 | 10/12/2026 |
| 4.0.46 | 871 | 10/12/2026 |
| 4.0.45 | 3,033 | 10/11/2026 |
| 4.0.44 | 126 | 10/11/2026 |
| 4.0.43 | 19,772 | 9/24/2026 |
| 4.0.42 | 105 | 9/24/2026 |
| 4.0.41 | 7,070 | 9/15/2026 |
| 4.0.40 | 119 | 9/15/2026 |
| 4.0.39 | 6,857 | 9/12/2026 |
| 4.0.38 | 139 | 9/12/2026 |
| 4.0.37 | 21,842 | 8/30/2026 |
Updated Multiple NuGet packages