Skip to content

Commit da5c87d

Browse files
update/readme
Updated readme and file header templates.
1 parent b3db323 commit da5c87d

File tree

4 files changed

+65
-90
lines changed

4 files changed

+65
-90
lines changed

OnixLabs.Core.UnitTests.Data/Mutable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020-2025 ONIXLabs
1+
// Copyright 2020 ONIXLabs
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

OnixLabs.Numerics.UnitTests.Data/TestDataAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020-2025 ONIXLabs
1+
// Copyright 2020 ONIXLabs
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

OnixLabs.Numerics.UnitTests/GenericMathPow10Tests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020-2025 ONIXLabs
1+
// Copyright 2020 ONIXLabs
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

README.md

Lines changed: 62 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -2,116 +2,91 @@
22

33
# ONIXLabs .NET Library
44

5-
The world of software development is ever-evolving, driven by the constant need for innovation, efficiency, and maintainability. In this landscape, libraries and frameworks play a crucial role in simplifying complex tasks, promoting code reuse, and fostering community collaboration. The ONIXLabs .NET Library is born out of this very ethos—a desire to create a robust, versatile, and community-friendly library that fills the gaps often encountered in various development projects.
5+
[![NET](https://github.com/onix-labs/onixlabs-dotnet/actions/workflows/dotnet.yml/badge.svg)](https://github.com/onix-labs/onixlabs-dotnet/actions/workflows/dotnet.yml)
66

7-
[![.NET](https://github.com/onix-labs/onixlabs-dotnet/actions/workflows/dotnet.yml/badge.svg)](https://github.com/onix-labs/onixlabs-dotnet/actions/workflows/dotnet.yml)
7+
The ONIXLabs .NET Library is a suite of general-purpose, production-ready libraries designed to support modern application development with a strong emphasis on correctness, composability, and value semantics. They are designed to integrate cleanly into both small utilities and large-scale systems, without imposing architectural constraints or framework lock-in.
88

9-
## ONIXLabs Core
9+
At a high level, ONIXLabs provides:
1010

11-
At the heart of the ONIXLabs .NET Library lies the Core module, serving as the bedrock for building resilient and scalable applications. Here, developers will find essential APIs and interfaces meticulously designed to promote code reusability, maintainability, and readability. From foundational interfaces to extension methods enriching object manipulation, ONIXLabs Core sets the stage for seamless development experiences.
11+
- Foundational primitives and patterns missing or underrepresented in the BCL
12+
- Functional and value-oriented abstractions for safer code
13+
- High-precision numeric and generic math utilities
14+
- Security and cryptography APIs with strong typing and value semantics
15+
- Infrastructure helpers that reduce boilerplate while preserving clarity
1216

13-
### Interfaces
17+
Current .NET Support includes .NET 8.0, 9.0 and 10.0, and all packages are published to [Nuget](https://www.nuget.org/packages?q=onixlabs).
1418

15-
The ONIXLabs .NET Library includes interfaces such as `IValueEquatable<T>`, `IValueComparable<T>`, and `IBinaryConvertible`, providing a foundation for implementing common patterns and functionalities.
19+
## Package Overview
1620

17-
### Extension Methods
21+
- **OnixLabs.Core** – Foundational primitives, patterns, and extensions
22+
- **OnixLabs.DependencyInjection** – Configuration-driven DI registration
23+
- **OnixLabs.Numerics** – Arbitrary-precision numbers and generic math
24+
- **OnixLabs.Security** – Non-cryptographic security utilities
25+
- **OnixLabs.Security.Cryptography** – Cryptographic primitives and structures
1826

19-
The ONIXLabs .NET Library extends the capabilities of objects, arrays, strings, sequences, comparables, and enumerables, making data manipulation more intuitive and efficient.
27+
## OnixLabs.Core
2028

21-
### Preconditions
29+
[See it on Nuget](https://www.nuget.org/packages/OnixLabs.Core)
2230

23-
The ONIXLabs .NET Library offers a comprehensive set of preconditions designed to facilitate clean, consistent, and reliable guard clauses. This promotes a "fail-fast" programming approach, ensuring that potential issues are identified and addressed early in the execution process.
31+
Foundational primitives, patterns, and extensions that address common gaps in the .NET Base Class Library. This package provides low-level building blocks used throughout the ONIXLabs ecosystem, but is also useful as a standalone utility library in any .NET application.
2432

25-
### Strong Enumeration Pattern
33+
- Strongly typed enumeration pattern (`Enumeration<T>`)
34+
- Functional patterns (`Optional<T>`, `Result`, `Result<T>`)
35+
- Preconditions and guard clause utilities
36+
- Specification pattern with LINQ-compatible expressions (`Specification<T>`)
37+
- Value semantics interfaces (`IValueEquatable<T>`, `IValueComparable<T>`)
38+
- Binary conversion abstractions (`IBinaryConvertible`, span- and memory-based variants)
39+
- Collection generators with LINQ-style query support
40+
- Extension methods for arrays, objects, strings, comparables, random, and more
41+
- Extensions for `IEnumerable`, `IEnumerable<T>`, and `IQueryable<T>`
42+
- Reflection helpers for `Type`
43+
- Strongly typed `Base16`, `Base32`, `Base58`, and `Base64` text types
44+
- Extensions for `StringBuilder` and `Encoding`
2645

27-
The ONIXLabs .NET Library provides an abstraction of the strong enumeration pattern, allowing consumers to build strict, strongly typed enumerations which can be extended with value and associated behavior.
46+
## OnixLabs.DependencyInjection
2847

29-
### Functional Concepts
48+
[See it on Nuget](https://www.nuget.org/packages/OnixLabs.DependencyInjection)
3049

31-
The ONIXLabs .NET Library includes robust implementations of the `Result`, `Result<T>`, and `Optional<T>` patterns, which are widely used in functional programming languages. These implementations address two prevalent challenges in object-oriented programming: exception handling and null reference management. By integrating these patterns, the library provides more predictable and maintainable code structures.
50+
Lightweight extensions for Microsoft’s dependency injection abstractions, focused on reducing boilerplate and improving configurability of service registration.
3251

33-
#### Result Pattern
52+
- `IServiceCollection` extensions
53+
- Configuration-driven service lifetime selection
54+
- Cleaner, more consistent registration APIs
3455

35-
Enables methods to return a success or failure state, encapsulating both the outcome and the associated data or error message. This approach simplifies error handling and improves code readability.
56+
## OnixLabs.Numerics
3657

37-
#### Optional Pattern
58+
[See it on Nuget](https://www.nuget.org/packages/OnixLabs.Numerics)
3859

39-
Facilitates the handling of potentially null values, thereby reducing the risk of `NullReferenceException` and promoting safer code practices.
60+
High-precision numeric types and generic math utilities for scenarios where built-in numeric types are insufficient. This package emphasizes correctness, precision, and introspection of numeric values.
4061

41-
#### Asynchronous Programming
62+
- Arbitrary-precision `BigDecimal` based on generic math (`IFloatingPoint<T>`)
63+
- `NumberInfo` for dissecting rational numbers into constituent parts
64+
- Generic numeric abstractions (`IBaseNumber<T>`, `INumber<T>`)
65+
- Extension methods for `Decimal`, `BigDecimal`, `BigInteger`, and other numeric types
4266

43-
The ONIXLabs .NET Library extends these patterns with asynchronous programming support, including extension methods that allow `Result`, `Result<T>`, and `Optional<T>` to be seamlessly integrated into asynchronous workflows. This makes it easier to work with these patterns in modern, async-based applications, ensuring consistent and reliable error and null handling across synchronous and asynchronous contexts.
67+
## OnixLabs.Security
4468

45-
### LINQ Extension Methods
69+
[See it on Nuget](https://www.nuget.org/packages/OnixLabs.Security)
4670

47-
The ONIXLabs .NET Library enhances the standard LINQ capabilities with additional extension methods for working with `IEnumerable` and `IEnumerable<T>`, making it easier to perform complex queries and manipulations on collections.
71+
Non-cryptographic security utilities focused on safe generation and handling of security-related values.
4872

49-
### Text Encoding Services
73+
- `SecurityToken` generation
74+
- Support for pseudo-random and cryptographically secure RNGs
75+
- Configurable token alphabets (upper, lower, numeric, special characters)
5076

51-
The ONIXLabs .NET Library provides codecs for various encoding schemes like `Base16`, `Base32`, `Base58`, and `Base64`, along with primitive structs representing these bases for semantic clarity.
77+
## OnixLabs.Security.Cryptography
5278

53-
## ONIXLabs Numerics
79+
[See it on Nuget](https://www.nuget.org/packages/OnixLabs.Security.Cryptography)
5480

55-
Numerical computations are a fundamental aspect of many software applications, often requiring precision, flexibility, and performance. The ONIXLabs .NET Library Numerics module equips developers with a suite of tools tailored to meet these demands. Whether it's obtaining detailed insights into numeric values or performing complex arithmetic operations, this module empowers developers to tackle numerical challenges with ease and confidence.
81+
Strongly typed cryptographic primitives and structures with value semantics, designed to make cryptographic operations safer and more explicit.
5682

57-
### Number Information
58-
59-
The ONIXLabs .NET Library includes a versatile struct called `NumberInfo` that provides detailed insights into any numeric value, including unscaled value, scale, significand, exponent, precision, and sign.
60-
61-
### Number Information Formatting
62-
63-
The ONIXLabs .NET Library features a comprehensive number formatting API that allows any number type convertible to `NumberInfo` to be formatted using various number styles. These styles include currency, decimal, exponential (scientific), fixed, general, number, and percentage formats. Additionally, the API supports automatic cultural formatting, ensuring that numbers are appropriately formatted according to different cultural conventions.
64-
65-
### Big Decimal
66-
67-
The ONIXLabs .NET Library provides an arbitrary-length `BigDecimal` number representation leveraging .NET's generic math interfaces. It supports a comprehensive range of arithmetic operations, parsing, conversion, and culture-specific formatting, facilitating precise numerical calculations.
68-
69-
### Generic Math Extension Methods
70-
71-
The ONIXLabs .NET Library extends the functionality of numerical types with useful generic math extension methods, enhancing flexibility and productivity in numerical computing tasks.
72-
73-
## ONIXLabs Security
74-
75-
The Security module in the ONIXLabs .NET Library focuses on non-cryptographic security measures, addressing various aspects of application security beyond encryption. This module provides tools and utilities to enhance the security of applications through mechanisms such as secure data handling, input validation, and access control. By implementing best practices and standards for secure coding, the Security module helps developers protect their applications from common vulnerabilities and threats, ensuring robust and reliable security across different components of the software.
76-
77-
### Security Tokens
78-
79-
The ONIXLabs .NET Library includes a powerful API for generating security tokens. These tokens are customizable sequences of random characters designed to function as temporary passwords or authentication codes. The API offers extensive configuration options, allowing developers to specify the length, character set, and complexity of the generated tokens to meet various security requirements. This flexibility ensures that the tokens can be tailored to different use cases, such as user verification, session management, or one-time password generation, thereby enhancing the security and usability of applications.
80-
81-
## ONIXLabs Cryptography
82-
83-
In an era marked by increasing cybersecurity threats, robust cryptographic implementations are paramount. The ONIXLabs Cryptography module offers developers a comprehensive set of APIs for handling cryptographic operations securely. From digital signatures and hash functions to Merkle trees and FIPS-202 compliant SHA3 implementations, developers can leverage ONIXLabs Cryptography to safeguard sensitive data and ensure the integrity and confidentiality of their applications.
84-
85-
### Public/Private Key Cryptography
86-
87-
The ONIXLabs .NET Library offers comprehensive support for public/private key cryptography, essential for secure communication and data encryption. The library includes abstractions such as `PublicKey` and `PrivateKey`, which encapsulate the raw byte data of cryptographic keys, providing a structured and secure way to handle key material. Additionally, the `NamedPublicKey` and `NamedPrivateKey` classes extend these abstractions by associating the keys with the name of the cryptographic algorithm used, enhancing clarity and ease of use in multi-algorithm contexts.
88-
89-
The library supports various cryptographic algorithms through interfaces and concrete implementations, including ECDSA (Elliptic Curve Digital Signature Algorithm), ECDH (Elliptic Curve Diffie-Hellman), and RSA (Rivest-Shamir-Adleman). These implementations enable secure key generation, digital signing, encryption, and decryption operations. For instance, ECDSA and RSA are used for generating and verifying digital signatures, ensuring data integrity and authenticity, while ECDH facilitates secure key exchange mechanisms.
90-
91-
By providing these abstractions and implementations, the ONIXLabs .NET Library ensures that developers can seamlessly integrate robust cryptographic functionality into their applications, leveraging the strengths of various cryptographic algorithms to meet diverse security requirements. This makes the library an invaluable tool for building secure, reliable, and high-performance applications in the .NET ecosystem.
92-
93-
### Digital Signatures
94-
95-
The ONIXLabs .NET Library provides several APIs for creating, storing, and verifying cryptographic digital signatures. The `DigitalSignature` struct is designed to encapsulate the underlying raw byte data of a cryptographic digital signature, ensuring the integrity and authenticity of digital messages, whilst the `DigitalSignatureAndPublicKey` struct combines a `DigitalSignature` with its corresponding `NamedPublicKey`, which is used to verify the authenticity of the digital signature.
96-
97-
### Hashing
98-
99-
The ONIXLabs .NET Library features a comprehensive set of APIs dedicated to creating and storing cryptographic hash values. At the core of these APIs is the `Hash` struct, which is designed to encapsulate the raw byte data of a cryptographic hash. This struct provides a robust and efficient way to handle hash values, ensuring data integrity and security across various applications.
100-
101-
In addition to basic hashing capabilities, the ONIXLabs .NET Library includes a fully managed implementation of the FIPS-202 standardized SHA3 algorithm. This implementation covers all major variants of SHA3, including SHA3-224, SHA3-256, SHA3-384, and SHA3-512, as well as the extendable-output functions SHAKE128 and SHAKE256. By adhering to the FIPS-202 standards, the library ensures compliance with cryptographic standards.
102-
103-
### Merkle Trees
104-
105-
The ONIXLabs .NET Library includes implementations of the `MerkleTree` and `MerkleTree<T>`, which are essential for constructing and managing Merkle trees. A Merkle tree is a cryptographic data structure that allows efficient and secure verification of the contents of large data sets. The `MerkleTree` class provides a general implementation, while `MerkleTree<T>` offers a generic version, where `T` implements `IHashable`. These implementations support the creation of Merkle trees by recursively hashing pairs of nodes until a single root hash, known as the Merkle root, is obtained. This root hash can then be used to verify the integrity and consistency of the entire data set with minimal computational overhead. The library's implementation ensures compatibility with various hash functions, making it a versatile tool for applications requiring secure data verification, such as blockchain or distributed ledger technologies, file integrity checks, and distributed systems.
106-
107-
### Salts
108-
109-
The ONIXLabs .NET Library includes a `Salt` struct designed to encapsulate cryptographically secure random numbers, which are essential for various security operations. Salts are random data added to passwords or other data before hashing to ensure that identical inputs produce unique hash values. This approach prevents attackers from using precomputed tables, such as rainbow tables, to reverse-engineer hashed data. The `Salt` struct in ONIXLabs provides a simple yet powerful way to generate and manage these cryptographic salts, ensuring they are sufficiently random and secure. By incorporating salts into hashing and encryption workflows, the library significantly enhances security, making it more resistant to attacks and ensuring the robustness of applications against potential vulnerabilities. This struct is particularly useful in scenarios like password storage, token generation, and any application requiring enhanced cryptographic security.
110-
111-
### Secrets
112-
113-
The ONIXLabs .NET Library includes a `Secret` struct, designed to securely handle sensitive data such as passwords, encryption keys, and other confidential information. The `Secret` struct ensures that sensitive data is managed with the highest level of security by leveraging secure memory management techniques to minimize the risk of exposure. It provides methods for securely storing, accessing, and disposing of sensitive information, ensuring that data is encrypted in memory and cleared immediately after use. This approach prevents unauthorized access and reduces the risk of memory-based attacks. The `Secret` struct is particularly valuable in applications that require stringent security measures, such as authentication systems, encryption services, and any scenario where sensitive data must be protected. By incorporating the `Secret` struct, the ONIXLabs .NET Library helps developers build more secure applications, safeguarding critical information against potential breaches and ensuring compliance with security best practices.
114-
115-
### In-Memory Encryption
116-
117-
The ONIXLabs .NET Library ensures the highest level of security for sensitive data by implementing in-memory encryption for `Secret` and `PrivateKey` data. This technique encrypts these critical pieces of information while they are stored in memory, thereby protecting them from memory dump attacks, unauthorized access, and other forms of in-memory exploitation. By encrypting sensitive data in memory, the library reduces the risk of exposure even if an attacker gains access to the system's memory. This approach is particularly effective in defending against certain classes of attacks, such as those that exploit vulnerabilities to read memory content directly. The encrypted memory handling for `Secret` and `PrivateKey` data is a key feature that enhances the overall security posture of applications using the ONIXLabs .NET Library, ensuring that sensitive information remains confidential and secure throughout its lifecycle.
83+
- Public and private key abstractions (`PublicKey`, `PrivateKey`)
84+
- ECDH, ECDSA, and RSA key implementations
85+
- Digital signature types (`DigitalSignature`, `DigitalSignatureAndPublicKey`)
86+
- Cryptographic hash value types (`Hash`, `NamedHash`)
87+
- Extensions for `HashAlgorithm`
88+
- Fully managed FIPS-202 SHA-3 implementation (SHA3-224/256/384/512, SHAKE128/256)
89+
- Merkle tree implementations (`MerkleTree`, `MerkleTree<T>`)
90+
- Cryptographic salt value type (`Salt`)
91+
- Encrypted-in-memory secret handling (`Secret`)
92+
- Common cryptographic primitive abstraction (`ICryptoPrimitive`)

0 commit comments

Comments
 (0)