nozzlegear / ShopifySharp

ShopifySharp is a .NET library that helps developers easily authenticate with and manage Shopify stores.
https://nozzlegear.com/shopify-development-handbook
MIT License
742 stars 309 forks source link

Add method to validate Shopify webhooks using `ReadOnlyMemory<byte>` #969

Closed nozzlegear closed 9 months ago

nozzlegear commented 9 months ago

Merging method contributed by @Socolin, at their request.

Benchmark:

Method Mean Error StdDev Median Gen0 Gen1 Allocated
Old 2.308 μs 0.0694 μs 0.2045 μs 2.392 μs 0.0057 0.0038 624 B
New 1.115 μs 0.0016 μs 0.0013 μs 1.115 μs - - 64 B
OldLarge 2.383 μs 0.0469 μs 0.0482 μs 2.384 μs 0.0114 0.0076 1088 B
NewLarge 1.245 μs 0.0022 μs 0.0018 μs 1.245 μs - - 64 B