Microsoft.Bcl.Memory 10.0.2
About
Provides Index and Range types to simplify slicing operations on collections for .NET Framework and .NET Standard 2.0.
Provides Base64Url for encoding data in a URL-safe manner on older .NET platforms.
Provides Utf8 for converting chunked data between UTF-8 and UTF-16 encodings on .NET Framework and .NET Standard 2.0.
This library is not necessary nor recommended when targeting versions of .NET that include the relevant support.
Key Features
- Enables the use of
IndexandRangetypes on .NET Framework and .NET Standard 2.0. - Provides
Base64Urlencoding, decoding, and validation for URL-safe data processing on older .NET platforms. - Provides
Utf8encoding, decoding, and validation for chunked data between UTF-8 and UTF-16 on .NET Framework and .NET Standard 2.0.
How to Use
The Index and Range types simplify working with slices of arrays, strings, or other collections.
string[] words = ["The", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"];
// Use Index to reference the last element
Console.WriteLine(words[^1]);
// Output: "dog"
// Use Range to reference a slice
string[] phrase = words[1..4];
Console.WriteLine(string.Join(" ", phrase));
// Output: "quick brown fox"
Base64Url encoding is a URL-safe version of Base64, commonly used in web applications, such as JWT tokens.
using System.Buffers.Text;
using System.Text;
// Original data
byte[] data = Encoding.UTF8.GetBytes("Hello World!");
Span<byte> encoded = new byte[Base64Url.GetEncodedLength(data.Length)];
Base64Url.EncodeToUtf8(data, encoded, out int _, out int bytesWritten);
string encodedString = Base64Url.EncodeToString(data);
Console.WriteLine($"Encoded: {encodedString}");
// Encoded: SGVsbG8gV29ybGQh
Span<byte> decoded = new byte[data.Length];
Base64Url.DecodeFromUtf8(encoded[..bytesWritten], decoded, out _, out bytesWritten);
string decodedString = Encoding.UTF8.GetString(decoded[..bytesWritten]);
Console.WriteLine($"Decoded: {decodedString}");
// Decoded: Hello World!
Main Types
The main types provided by this library are:
System.IndexSystem.RangeSystem.Buffers.Text.Base64UrlSystem.Text.Unicode.Utf8
Additional Documentation
API documentation
Feedback & Contributing
Microsoft.Bcl.Memory is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Showing the top 20 packages that depend on Microsoft.Bcl.Memory.
| Packages | Downloads |
|---|---|
|
ModelContextProtocol.Core
Core .NET SDK for the Model Context Protocol (MCP)
|
25 |
|
ModelContextProtocol.Core
Core .NET SDK for the Model Context Protocol (MCP)
|
22 |
|
J2N
J2N is a library that helps bridge the gap between .NET and Java. It provides components to assist with porting Java code to .NET, such as collections, adapters, and extensions. It contains some features from Java that also make it generally useful in any .NET application.
|
22 |
|
ModelContextProtocol.Core
Core .NET SDK for the Model Context Protocol (MCP)
|
21 |
|
ModelContextProtocol
.NET SDK for the Model Context Protocol (MCP)
|
21 |
|
Microsoft.IdentityModel.Tokens
Includes types that provide support for SecurityTokens, Cryptographic operations: Signing, Verifying Signatures, Encryption.
|
20 |
|
ModelContextProtocol
.NET SDK for the Model Context Protocol (MCP)
|
20 |
|
ModelContextProtocol.Core
Core .NET SDK for the Model Context Protocol (MCP)
|
20 |
|
Microsoft.IdentityModel.Tokens
Includes types that provide support for SecurityTokens, Cryptographic operations: Signing, Verifying Signatures, Encryption.
|
19 |
|
ModelContextProtocol
.NET SDK for the Model Context Protocol (MCP)
|
19 |
|
ModelContextProtocol.Core
Core .NET SDK for the Model Context Protocol (MCP)
|
19 |
|
Microsoft.Azure.Functions.Worker.Core
This library provides the core functionality to build an Azure Functions .NET Worker, adding support for the isolated, out-of-process execution model.
|
19 |
|
Microsoft.IdentityModel.Tokens
Includes types that provide support for SecurityTokens, Cryptographic operations: Signing, Verifying Signatures, Encryption.
|
18 |
|
ModelContextProtocol
.NET SDK for the Model Context Protocol (MCP)
|
18 |
|
System.Linq.AsyncEnumerable
System.Linq.AsyncEnumerable
|
18 |
.NET Framework 4.6.2
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
- System.ValueTuple (>= 4.6.1)
.NET 8.0
- No dependencies.
.NET 9.0
- No dependencies.
.NET 10.0
- No dependencies.
.NET Standard 2.0
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
.NET Standard 2.1
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
| Version | Downloads | Last updated |
|---|---|---|
| 11.0.0 | 1 | 11/23/2026 |
| 11.0.0-rc.3.26522.148 | 5 | 10/29/2026 |
| 11.0.0-rc.2.26504.105 | 5 | 11/06/2026 |
| 11.0.0-rc.1.26425.128 | 17 | 09/11/2026 |
| 11.0.0-preview.7.26381.103 | 0 | 08/11/2026 |
| 11.0.0-preview.6.26359.118 | 17 | 07/17/2026 |
| 11.0.0-preview.5.26302.115 | 15 | 06/26/2026 |
| 11.0.0-preview.4.26230.115 | 19 | 06/21/2026 |
| 11.0.0-preview.3.26207.106 | 18 | 07/06/2026 |
| 11.0.0-preview.2.26159.112 | 19 | 06/24/2026 |
| 11.0.0-preview.1.26104.118 | 20 | 06/21/2026 |
| 10.0.15 | 2 | 11/13/2026 |
| 10.0.14 | 2 | 11/06/2026 |
| 10.0.13 | 6 | 11/06/2026 |
| 10.0.12 | 9 | 09/13/2026 |
| 10.0.11 | 13 | 10/04/2026 |
| 10.0.10 | 21 | 07/16/2026 |
| 10.0.9 | 20 | 06/21/2026 |
| 10.0.8 | 18 | 06/27/2026 |
| 10.0.7 | 19 | 06/21/2026 |
| 10.0.6 | 13 | 06/21/2026 |
| 10.0.5 | 17 | 06/21/2026 |
| 10.0.4 | 19 | 06/21/2026 |
| 10.0.3 | 20 | 06/21/2026 |
| 10.0.2 | 11 | 06/27/2026 |
| 10.0.1 | 27 | 06/21/2026 |
| 10.0.0 | 13 | 06/21/2026 |
| 10.0.0-rc.2.25502.107 | 20 | 06/22/2026 |
| 10.0.0-rc.1.25451.107 | 17 | 06/21/2026 |
| 10.0.0-preview.7.25380.108 | 16 | 07/05/2026 |
| 10.0.0-preview.6.25358.103 | 18 | 06/22/2026 |
| 10.0.0-preview.5.25277.114 | 21 | 06/21/2026 |
| 10.0.0-preview.4.25258.110 | 15 | 07/01/2026 |
| 10.0.0-preview.3.25171.5 | 13 | 06/20/2026 |
| 10.0.0-preview.2.25163.2 | 22 | 06/30/2026 |
| 10.0.0-preview.1.25080.5 | 21 | 06/21/2026 |
| 9.0.23 | 1 | 11/20/2026 |
| 9.0.22 | 11 | 10/28/2026 |
| 9.0.21 | 5 | 11/03/2026 |
| 9.0.20 | 10 | 09/14/2026 |
| 9.0.19 | 12 | 08/14/2026 |
| 9.0.18 | 17 | 07/16/2026 |
| 9.0.17 | 13 | 06/20/2026 |
| 9.0.16 | 14 | 06/21/2026 |
| 9.0.15 | 12 | 06/29/2026 |
| 9.0.14 | 19 | 06/20/2026 |
| 9.0.13 | 15 | 06/27/2026 |
| 9.0.12 | 11 | 06/27/2026 |
| 9.0.11 | 21 | 06/21/2026 |
| 9.0.10 | 19 | 06/27/2026 |
| 9.0.9 | 18 | 07/01/2026 |
| 9.0.8 | 15 | 07/18/2026 |
| 9.0.7 | 13 | 06/27/2026 |
| 9.0.6 | 22 | 06/21/2026 |
| 9.0.5 | 19 | 06/21/2026 |
| 9.0.4 | 16 | 06/27/2026 |
| 9.0.3 | 24 | 06/21/2026 |
| 9.0.2 | 15 | 06/21/2026 |
| 9.0.1 | 13 | 06/21/2026 |
| 9.0.0 | 23 | 06/27/2026 |
| 9.0.0-rc.2.24473.5 | 18 | 06/21/2026 |
| 9.0.0-rc.1.24431.7 | 18 | 06/24/2026 |
| 9.0.0-preview.7.24405.7 | 17 | 06/20/2026 |