Changelog
Notable changes in each release.
All notable changes to ArturRios.Util are recorded in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
2.2.0 - 2026-10-29
Added
Condition.BlankFailureMessage, the errorToProcessOutputreports for a condition that failed with a blank message.
Changed
FileReader.ReadAndDeserialize<T>andFileReaderAsync.ReadAndDeserializeAsync<T>match JSON property names regardless of case, asHttpOutput<TBody>already did. A camelCase file used to bind every member to its default without any error, so the same document read differently from disk than over HTTP.HashConfigurationrejects a memory size below 4 KB per degree of parallelism withArgumentOutOfRangeExceptionwhen it is constructed. Argon2 cannot run with less, and such a configuration used to fail only when hashing, with anAggregateException.- The package’s project URL is the documentation site’s new address,
https://docs.artur-rios.tech/dotnet-util, since the site moved from GitHub Pages.
Fixed
Condition.ToProcessOutputreturns a failed output whenever the condition is not satisfied. A condition that failed with an empty or whitespace message converted into a successfulProcessOutput, becauseProcessOutput.AddErrorsdrops such messages; such a failure is now reported as the newCondition.BlankFailureMessage.- The XML documentation of
CharacterChecksandRegexCollection.HasNumberLowerAndUpperCharPatternstates that the composite pattern’s\daccepts non-ASCII digits, instead of claiming the two agree on every input.
2.1.0 - 2026-08-24
Added
AnsiColors.Reset, the escape sequence that ends a colour.
Changed
ArturRios.Outputupdated from 3.1.0 to 3.2.0.
Fixed
- The library links under “Documentation” in the README returned 404; they point at
/dotnet-util/docs/<page>/.
2.0.0 - 2026-08-19
Several of the fixes in this release change results or signatures; what to change in calling code is described in Upgrading from 1.x to 2.0.
Added
HttpOutput.ContentHeaders,RawBodyandIsSuccess.Hash.TextMatchesaccepts theHashConfigurationthe hash was produced with.FileReaderAsyncmethods take an optionalCancellationToken.
Changed
- Breaking:
Retry.MaxAttempts(n)means n total executions instead ofn + 1, and a reusedRetrykeeps its configuration. - Breaking:
CustomRandom.NumberFromSystemRandomtreatsendas inclusive. - Breaking:
Characters.Specialgained the backtick, tilde and backslash. - Breaking:
HttpOutputandHttpGatewayserialize withSystem.Text.Jsoninstead ofNewtonsoft.Json. - Breaking:
Conditionreports duplicate failure messages once per failing condition, andFailsWiththrows when noTrue/Falseprecedes it. - Breaking:
HttpOutput.StatusCode,HeadersandBodyare read-only. - Breaking:
HttpStatusCodesgroups areImmutableArray<int>rather thanint[]. - Breaking:
PrimeGenerator<T>is constrained toIBinaryInteger<T>. - Breaking:
ConditionFailedException.Errorsis a property rather than a public field. - Breaking:
Retry,JitteredWaiter,HashConfiguration,HashandCustomRandomreject out-of-range arguments, andReadAsDictionaryrejects duplicate header names.
Removed
- Breaking:
JitteredWaiter.Wait()andHttpOutput.ReadContent(), replaced by their async counterparts. - The
Newtonsoft.Jsondependency.
Fixed
PrimeUtils.IsPrimeNumber(long)rejects negative values, andIsPrimeNumber(BigInteger)returns for large operands.JitteredWaiterwaits are capped atmaxWaitMillisecondsinstead of overflowing.NumberFromRngaccepts a range ending atint.MaxValue.HttpOutputno longer lets a body that does not match the expected shape escape to the caller as an exception.- The Argon2 and HTTP resources that were leaking are disposed.
Security
Hash.TextMatchescompares in constant time.
Upgrading from 1.x to 2.0
2.0 fixes several correctness bugs. Most call sites need no change, but the following behave differently.
Correctness fixes that change results
PrimeUtils.IsPrimeNumber(long)rejects negative values. It previously reinterpreted the bits asulong, soIsPrimeNumber(-59L)returnedtrue.PrimeUtils.IsPrimeNumber(BigInteger)uses Miller-Rabin above 2^64 instead of trial division, which never returned for a large operand. Below 2^64 the answer is still exact; above it, a “prime” verdict is probabilistic with an error probability below 4^-40.Retry.MaxAttempts(n)now means n total executions. It previously rann + 1times, and consumed its own configuration, so a reused instance had no attempts left. Add one to your argument to keep the old execution count.CustomRandom.NumberFromSystemRandomtreatsendas inclusive, matchingNumberFromRng. Passend - 1to keep the old exclusive behavior.Characters.Specialgained the backtick, tilde and backslash, completing the ASCII punctuation set. This changes the alphabetCustomRandom.Textdraws from and whatHasSpecialCharreports.HttpOutputandHttpGatewayserialize withSystem.Text.Jsoninstead ofNewtonsoft.Json; property matching on deserialization stays case insensitive. TheNewtonsoft.Jsondependency is gone.Conditionreports duplicate failure messages once per failing condition instead of collapsing them, andFailsWiththrowsInvalidOperationExceptionwhen noTrue/Falseprecedes it.
Signature and type changes
JitteredWaiter.Wait()is removed; useWaitAsync(CancellationToken). Waits are now capped atmaxWaitMilliseconds(30 s by default) rather than overflowing past ~20 retries.HttpOutput.ReadContent()is removed; useReadContentAsync(CancellationToken).StatusCode,HeadersandBodyare read-only, andContentHeaders,RawBodyandIsSuccessare new.HttpStatusCodesgroups areImmutableArray<int>rather thanint[].PrimeGenerator<T>is constrained toIBinaryInteger<T>. An unsupportedTis now a compile error instead of a constructorArgumentException.ConditionFailedException.Errorsis a property rather than a public field.FileReaderAsyncmethods take an optionalCancellationToken.
Newly enforced validation
Retry.MaxAttemptsandDelayMilliseconds,JitteredWaiter’s constructor, andHashConfiguration’s cost parameters all reject out-of-range values.Hashrejects empty text and salts shorter than 8 bytes, andHash.TextMatchescompares in constant time and accepts theHashConfigurationthe hash was produced with.CustomRandomrejects an inverted range, and a single-value range equal todifferentFrom, instead of looping forever.CustomRandom.Textgives up withInvalidOperationExceptionwhendifferentFromexcludes everything it can produce.ReadAsDictionarythrows on duplicate header names instead of silently dropping a column.
1.6.0 - 2026-08-19
Added
CharacterChecks—HasNumber,HasLowerChar,HasUpperCharandHasSpecialCharover bothstringandReadOnlySpan<char>— a vectorized alternative to the character class regexes.- The
CharacterClassesflags enum withClassifyandMissing, which name the character classes a value lacks. EmailAddress.TryNormalizeandIsValid, which lowercase the domain and punycode an internationalized one before applyingEmailPattern.
Changed
EmailPatternis stricter: domain labels must start and end with an alphanumeric character, underscores are no longer allowed in the domain, the local part is ASCII only, and the top-level domain limit rises from 4 to 63 characters. IPv4 hosts are accepted only in the bracketed form, with octets bounded to 0-255, so an unbracketed host such as[email protected]no longer matches.- Every generated regex has a 100 ms match timeout.
Fixed
- End-anchored patterns use
\zinstead of$, so a value with a trailing newline, such as"[email protected]\n", no longer passes.
1.5.0 - 2026-07-30
Changed
CustomRandom.Textrejects requests it cannot satisfy: no character set enabled, or a length below the number of enabled sets.
Fixed
CustomRandom.Textbuilds its alphabet from the enabled character sets only; it used to pad the result from every set, ignoring the flags.
Security
CustomRandom.Textgenerates and shuffles withRandomNumberGeneratorinstead ofSystem.Random.
1.4.2 - 2026-07-23
Changed
ArturRios.Outputupdated from 3.0.0 to 3.1.0.
1.4.1 - 2026-07-23
Changed
ArturRios.Outputupdated from 1.0.1 to 3.0.0.
1.4.0 - 2026-07-23
Added
HttpStatusCodesconstants for 202, the 3xx redirection codes, 405, 409, 422, 429, 503 and 504, plus aRedirectiongroup folded intoAll.
1.3.0 - 2026-07-21
Added
CustomConsole.WriteCharLinein the newConsolenamespace, to print a separator line of one repeated character.
1.2.0 - 2026-06-26
Added
PrimeUtilsandPrimeGenerator<T>in the newMathnamespace.
1.1.0 - 2025-12-15
Added
HttpGateway,HttpOutput,HttpStatusCodesand HTTP extension methods in the newHttpnamespace.
1.0.0 - 2025-12-05
Added
AnsiColorsandCharacterscollections.- Flow control:
Condition,RetryandJitteredWaiter. - Argon2id hashing with
HashandHashConfiguration. FileReaderandFileReaderAsyncfile I/O helpers.CustomRandomrandom numbers and strings, configured withRandomStringOptions.RegexCollectionand regex extension methods.