Sharpify 2.0.0

dotnet add package Sharpify --version 2.0.0
NuGet\Install-Package Sharpify -Version 2.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Sharpify" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Sharpify --version 2.0.0
#r "nuget: Sharpify, 2.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Sharpify as a Cake Addin
#addin nuget:?package=Sharpify&version=2.0.0

// Install Sharpify as a Cake Tool
#tool nuget:?package=Sharpify&version=2.0.0

CHANGELOG

v2.0.0

  • Performance improvements to parallel extensions that use AsyncLocal

    • The changes are BREAKING as now the call sites should use newer convention, behavior will be the same.
    • Instead of the previous .AsAsyncLocal, there are now 2 overloads, both use nested generics which is the reason for the update, instead of IList<T> they use <TList, TItem> where TList : IList<TItem>. The first overload with no additional parameters can be used but it will require to specify both generic types as the compiler cannot infer TItem for some reason. To partially compensate for the verbosity it creates when using complex types, a second overload accepts a TItem? @default argument. Specifying default(TItem) there will enable the compiler to infer the generic.
    // EXAMPLE
    var items = List<int>() { 1, 2, 3 };
    _ = items.AsAsyncLocal<List<int>, int>(); // Overload 1 with no arguments
    _ = items.AsAsyncLocal(default(int)); // Overload 2 with TItem? @default
    
    • This might seem like a step backwards but using a nested generic here, can improve performance by not virtualizing interface calls to IList<T>, and also enable the compiler to more accurately trim the code when compiling to NativeAOT.
  • Both overloads of DecryptBytes in AesProvider now have an optional parameter throwOnError which is set to false by default, retaining the previous behavior. Setting it to true will make sure the exception is thrown in case of a CryptographicException instead of just returning an empty array or 0 (respective of the overloads). This might help catch certain issues.

    • Note: Previously and still now, exceptions other than CryptographicException would and will be thrown. They are not caught in the methods.
  • Implement a trick in RemoveDuplicatesFromSorted, RemoveDuplicates, RemoveDuplicatesSorted and TryConvertToInt32 to ensure the compiler knows to remove the bounds checking from the loops.

  • IComparer<T> parameter type in SortedList<T> was changed to Comparer<T>, the interface virtualization seemed to make custom comparers produce unexpected results.

  • StringBuffer and AllocatedStringBuffer can now use the builder pattern to chain its construction, same as StringBuilder.

    var buffer = StringBuffer.Create(stackalloc char[20]).Append("Hello").AppendLine().Append("World");
    
    • This change required each method to return the actual reference of the struct, Use this with caution as this means you can change the actual reference instead of a copy if you manually assign it a new value.
    • From my testing, with correct usage, without manually assigning values to the original variable, previous and builder pattern usage passes my tests. If you encounter any issue with this, make sure to submit it in the GitHub repo.
  • Fixed edge case where pausing an AsyncRoutine would stop it permanently, regardless of calls to Resume.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Sharpify:

Package Downloads
Sharpify.Data

An extension of Sharpify, focused on Data

Sharpify.CommandLineInterface

An extension of Sharpify, focused on creating command line interfaces

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.0.0 73 6/3/2024
1.8.1 74 5/30/2024
1.8.0 94 4/17/2024
1.7.3 131 1/29/2024
1.7.2 89 1/23/2024
1.7.1 177 1/20/2024
1.7.0 77 1/20/2024
1.6.0 100 1/15/2024
1.5.0 93 1/10/2024
1.4.2 98 1/8/2024
1.4.1 126 1/4/2024
1.4.0 109 1/4/2024
1.3.1 107 12/31/2023
1.3.0 112 12/31/2023
1.2.0 114 12/24/2023
1.1.0 135 12/7/2023
1.0.9 96 12/7/2023
1.0.8 135 11/22/2023
1.0.7 109 9/23/2023
1.0.6 131 8/21/2023
1.0.5 148 5/4/2023
1.0.4 138 4/23/2023
1.0.3 150 4/19/2023
1.0.2 146 4/19/2023
1.0.1 159 4/14/2023
1.0.0 156 4/14/2023