Skip to content

Version 9.0.0

Compare
Choose a tag to compare
@MrMatthewLayton MrMatthewLayton released this 19 Jul 15:00
· 15 commits to main since this release

ONIXLabs .NET Library 9.0.0

We are excited to announce the release of ONIXLabs .NET Library version 9.0.0, now available on NuGet. This version includes significant new features, enhanced code coverage, and improved performance. The entire codebase has been thoroughly analyzed and refactored to reduce heap allocations, eliminate unnecessary virtual method calls, and optimize computationally intensive algorithms.

Core Updates

  • Introducing the new ISpanBinaryConvertible interface, enabling objects to return their underlying byte array as a ReadOnlySpan<T>. This allows consumers to work with the original object's bytes without mutation or additional allocations.

  • Adding new LINQ-like extension methods for non-generic IEnumerable, such as Count, LongCount, ForEach, GetContentHashCode, IsEmpty, IsNotEmpty, IsSingle, IsCountEven, IsCountOdd, JoinToString, and ToCollectionString.

  • Result<T> now implements IDisposable and IAsyncDisposable, allowing for use in using and async using statements. This ensures proper disposal of underlying values that implement these interfaces.

  • Adding async method extensions for Result, Result<T>, and Optional<T>, facilitating seamless integration into async workflows.

  • Enhancing pre-condition guard clauses to handle nullable structs and strings that are null, empty, or whitespace.

  • Updating the GetName extension to support formatting with full type names and generic type arguments, configurable via the new TypeNameFlags enumeration.

  • Improving the ToRecordString extension to support more expressive record-like strings, including formatting for collection types and null values.

Cryptography Updates

  • Introducing new record types: NamedHash, NamedPrivateKey, NamedPublicKey, and DigitalSignatureAndPublicKey.

  • Fixing an issue in the SHA3 implementation where the hash length was incorrectly set.