Skip to content

Commit 51d334e

Browse files
Final remaining XMLDoc and code changes.
1 parent c405c9b commit 51d334e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+437
-461
lines changed

OnixLabs.DependencyInjection/Extensions.IServiceCollection.cs

Lines changed: 155 additions & 166 deletions
Large diffs are not rendered by default.

OnixLabs.Numerics/BigDecimal.Arithmetic.Division.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public readonly partial struct BigDecimal
2828
/// <returns>Returns the quotient of the specified <see cref="BigDecimal"/> values.</returns>
2929
public static BigDecimal Divide(BigDecimal left, BigDecimal right, MidpointRounding mode = default)
3030
{
31-
RequireIsDefined(mode, nameof(mode));
31+
RequireIsDefined(mode);
3232

3333
if (right == Zero) throw new DivideByZeroException();
3434
if (right == One) return left;

OnixLabs.Numerics/BigDecimal.Arithmetic.Scale.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public readonly partial struct BigDecimal
3030
public static BigDecimal SetScale(BigDecimal value, int scale, MidpointRounding mode = default)
3131
{
3232
Require(scale >= 0, "Scale must be greater than or equal to zero.", nameof(scale));
33-
RequireIsDefined(mode, nameof(mode));
33+
RequireIsDefined(mode);
3434

3535
if (scale == value.Scale) return value;
3636
if (scale < value.Scale) return Round(value, scale, mode);

OnixLabs.Numerics/BigDecimal.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ namespace OnixLabs.Numerics;
3838
public BigDecimal(BigInteger value, int scale = 0, ScaleMode mode = default)
3939
{
4040
Require(scale >= 0, "Scale must be greater than or equal to zero.", nameof(scale));
41-
RequireIsDefined(mode, nameof(mode));
41+
RequireIsDefined(mode);
4242
number = value.ToNumberInfo(scale, mode);
4343
}
4444

@@ -49,7 +49,7 @@ public BigDecimal(BigInteger value, int scale = 0, ScaleMode mode = default)
4949
/// <param name="mode">The conversion mode that determines whether the floating-point value should be converted from its binary or decimal representation.</param>
5050
public BigDecimal(float value, ConversionMode mode = default)
5151
{
52-
RequireIsDefined(mode, nameof(mode));
52+
RequireIsDefined(mode);
5353
number = value.ToNumberInfo(mode);
5454
}
5555

@@ -60,7 +60,7 @@ public BigDecimal(float value, ConversionMode mode = default)
6060
/// <param name="mode">The conversion mode that determines whether the floating-point value should be converted from its binary or decimal representation.</param>
6161
public BigDecimal(double value, ConversionMode mode = default)
6262
{
63-
RequireIsDefined(mode, nameof(mode));
63+
RequireIsDefined(mode);
6464
number = value.ToNumberInfo(mode);
6565
}
6666

OnixLabs.Numerics/Ieee754Converter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ internal static class Ieee754Converter
3535
public static NumberInfo Convert(float value, ConversionMode mode)
3636
{
3737
RequireRealNumber(value);
38-
RequireIsDefined(mode, nameof(mode));
38+
RequireIsDefined(mode);
3939

4040
if (IsZeroOrOne(value, out NumberInfo result)) return result;
4141

@@ -56,7 +56,7 @@ public static NumberInfo Convert(float value, ConversionMode mode)
5656
public static NumberInfo Convert(double value, ConversionMode mode)
5757
{
5858
RequireRealNumber(value);
59-
RequireIsDefined(mode, nameof(mode));
59+
RequireIsDefined(mode);
6060

6161
if (IsZeroOrOne(value, out NumberInfo result)) return result;
6262

OnixLabs.Numerics/NumericsExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public static BigInteger GetUnscaledValue(this decimal value)
7171
/// <exception cref="ArgumentException"> if <paramref name="scale"/> is negative.</exception>
7272
public static decimal SetScale(this decimal value, int scale)
7373
{
74-
RequireWithinRangeInclusive(scale, 0, MaxScale, "Scale must be within the inclusive range of 0 to 28.", nameof(scale));
74+
RequireWithinRangeInclusive(scale, 0, MaxScale, "Scale must be within the inclusive range of 0 to 28.");
7575

7676
// Determine maximum representable scale given the integer part length
7777
BigInteger unscaledValue = value.GetUnscaledValue();
@@ -121,7 +121,7 @@ public static decimal SetScale(this decimal value, int scale)
121121
/// <exception cref="ArgumentException"> if <paramref name="scale"/> is negative.</exception>
122122
public static decimal SetScale(this decimal value, int scale, MidpointRounding mode)
123123
{
124-
RequireWithinRangeInclusive(scale, 0, MaxScale, "Scale must be within the inclusive range of 0 to 28.", nameof(scale));
124+
RequireWithinRangeInclusive(scale, 0, MaxScale, "Scale must be within the inclusive range of 0 to 28.");
125125

126126
// Determine maximum representable scale
127127
BigInteger unscaledValue = value.GetUnscaledValue();
@@ -170,7 +170,7 @@ public static decimal SetScale(this decimal value, int scale, MidpointRounding m
170170
private static BigInteger GetUnscaledInteger<T>(this T value, int scale, ScaleMode mode) where T : IBinaryInteger<T>
171171
{
172172
Require(scale >= 0, "Scale must be greater than or equal to zero.", nameof(value));
173-
RequireIsDefined(mode, nameof(mode));
173+
RequireIsDefined(mode);
174174

175175
BigInteger integer = value.ToBigInteger();
176176
return scale == 0 || mode == ScaleMode.Fractional ? integer : integer * BigInteger.Pow(10, scale);
@@ -239,7 +239,7 @@ public static BigDecimal ToBigDecimal<T>(this T value, int scale = 0, ScaleMode
239239
public static decimal ToDecimal<T>(this T value, int scale = 0, ScaleMode mode = default) where T : IBinaryInteger<T>
240240
{
241241
Require(scale.IsBetween(0, 28), "Scale must be between 0 and 28.");
242-
RequireIsDefined(mode, nameof(mode));
242+
RequireIsDefined(mode);
243243

244244
BigInteger scaled = value.GetUnscaledInteger(scale, mode);
245245
Check(scaled.IsBetween(MinDecimal, MaxDecimal), $"Value is either too large or too small to convert to {nameof(Decimal)}.");
@@ -263,7 +263,7 @@ public static decimal ToDecimal<T>(this T value, int scale = 0, ScaleMode mode =
263263
public static NumberInfo ToNumberInfo<T>(this T value, int scale = 0, ScaleMode mode = default) where T : IBinaryInteger<T>
264264
{
265265
Require(scale >= 0, "Scale must be greater than or equal to zero", nameof(scale));
266-
RequireIsDefined(mode, nameof(mode));
266+
RequireIsDefined(mode);
267267
BigInteger unscaledValue = value.GetUnscaledInteger(scale, mode);
268268
return new NumberInfo(unscaledValue, scale);
269269
}
@@ -276,7 +276,7 @@ public static NumberInfo ToNumberInfo<T>(this T value, int scale = 0, ScaleMode
276276
/// <returns>Returns a <see cref="NumberInfo"/> representing the current value.</returns>
277277
public static NumberInfo ToNumberInfo(this float value, ConversionMode mode = default)
278278
{
279-
RequireIsDefined(mode, nameof(mode));
279+
RequireIsDefined(mode);
280280
return Ieee754Converter.Convert(value, mode);
281281
}
282282

@@ -288,7 +288,7 @@ public static NumberInfo ToNumberInfo(this float value, ConversionMode mode = de
288288
/// <returns>Returns a <see cref="NumberInfo"/> representing the current value.</returns>
289289
public static NumberInfo ToNumberInfo(this double value, ConversionMode mode = default)
290290
{
291-
RequireIsDefined(mode, nameof(mode));
291+
RequireIsDefined(mode);
292292
return Ieee754Converter.Convert(value, mode);
293293
}
294294

OnixLabs.Security.Cryptography/DigitalSignature.Convertible.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ namespace OnixLabs.Security.Cryptography;
2020
public readonly partial struct DigitalSignature
2121
{
2222
/// <summary>
23-
/// Gets the underlying <see cref="T:Byte[]"/> representation of the current <see cref="DigitalSignature"/> instance as a new <see cref="ReadOnlyMemory{T}"/> instance.
23+
/// Gets the underlying <see cref="byte"/> array representation of the current <see cref="DigitalSignature"/> instance as a new <see cref="ReadOnlyMemory{T}"/> instance.
2424
/// </summary>
25-
/// <returns>Return the underlying <see cref="T:Byte[]"/> representation of the current <see cref="DigitalSignature"/> instance as a new <see cref="ReadOnlyMemory{T}"/> instance.</returns>
25+
/// <returns>Return the underlying <see cref="byte"/> array representation of the current <see cref="DigitalSignature"/> instance as a new <see cref="ReadOnlyMemory{T}"/> instance.</returns>
2626
public ReadOnlyMemory<byte> AsReadOnlyMemory() => value;
2727

2828
/// <summary>
29-
/// Gets the underlying <see cref="T:Byte[]"/> representation of the current <see cref="DigitalSignature"/> instance as a new <see cref="ReadOnlySpan{T}"/> instance.
29+
/// Gets the underlying <see cref="byte"/> array representation of the current <see cref="DigitalSignature"/> instance as a new <see cref="ReadOnlySpan{T}"/> instance.
3030
/// </summary>
31-
/// <returns>Return the underlying <see cref="T:Byte[]"/> representation of the current <see cref="DigitalSignature"/> instance as a new <see cref="ReadOnlySpan{T}"/> instance.</returns>
31+
/// <returns>Return the underlying <see cref="byte"/> array representation of the current <see cref="DigitalSignature"/> instance as a new <see cref="ReadOnlySpan{T}"/> instance.</returns>
3232
public ReadOnlySpan<byte> AsReadOnlySpan() => value;
3333

3434
/// <summary>
35-
/// Create a new <see cref="DigitalSignature"/> instance from the specified <see cref="T:byte[]"/> value.
35+
/// Create a new <see cref="DigitalSignature"/> instance from the specified <see cref="byte"/> array value.
3636
/// </summary>
3737
/// <param name="value">The value from which to create a new <see cref="DigitalSignature"/> instance.</param>
38-
/// <returns>Returns a new <see cref="DigitalSignature"/> instance from the specified <see cref="T:byte[]"/> value.</returns>
38+
/// <returns>Returns a new <see cref="DigitalSignature"/> instance from the specified <see cref="byte"/> array value.</returns>
3939
public static implicit operator DigitalSignature(byte[] value) => new(value);
4040

4141
/// <summary>

OnixLabs.Security.Cryptography/DigitalSignature.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ namespace OnixLabs.Security.Cryptography;
2424
/// <param name="value">The underlying value of the cryptographic digital signature.</param>
2525
public readonly partial struct DigitalSignature(ReadOnlySpan<byte> value) : ICryptoPrimitive<DigitalSignature>, ISpanParsable<DigitalSignature>
2626
{
27+
private readonly byte[] value = value.ToArray();
28+
2729
/// <summary>
2830
/// Initializes a new instance of the <see cref="DigitalSignature"/> struct.
2931
/// </summary>
3032
/// <param name="value">The <see cref="ReadOnlySequence{T}"/> with which to initialize the <see cref="DigitalSignature"/> instance.</param>
3133
// ReSharper disable once MemberCanBePrivate.Global
3234
public DigitalSignature(ReadOnlySequence<byte> value) : this(ReadOnlySpan<byte>.Empty) => value.CopyTo(out this.value);
33-
34-
private readonly byte[] value = value.ToArray();
3535
}

OnixLabs.Security.Cryptography/DigitalSignatureAndPublicKey.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ namespace OnixLabs.Security.Cryptography;
1919
/// </summary>
2020
/// <param name="Signature">The underlying cryptographic digital signature.</param>
2121
/// <param name="Key">The underlying named cryptographic public key.</param>
22+
// ReSharper disable UnusedType.Global NotAccessedPositionalProperty.Global
2223
public readonly record struct DigitalSignatureAndPublicKey(DigitalSignature Signature, NamedPublicKey Key);

OnixLabs.Security.Cryptography/EcdhPrivateKey.Convertible.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ namespace OnixLabs.Security.Cryptography;
2121
public sealed partial class EcdhPrivateKey
2222
{
2323
/// <summary>
24-
/// Create a new <see cref="EcdhPrivateKey"/> instance from the specified <see cref="T:byte[]"/> value.
24+
/// Create a new <see cref="EcdhPrivateKey"/> instance from the specified <see cref="byte"/> array value.
2525
/// </summary>
2626
/// <param name="value">The value from which to create a new <see cref="EcdhPrivateKey"/> instance.</param>
27-
/// <returns>Returns a new <see cref="EcdhPrivateKey"/> instance from the specified <see cref="T:byte[]"/> value.</returns>
27+
/// <returns>Returns a new <see cref="EcdhPrivateKey"/> instance from the specified <see cref="byte"/> array value.</returns>
2828
public static implicit operator EcdhPrivateKey(byte[] value) => new(value);
2929

3030
/// <summary>

0 commit comments

Comments
 (0)