File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,18 +56,19 @@ public uint RunBlake3ManagedParallel()
5656 return MemoryMarshal . Cast < byte , uint > ( hasher . Finalize ( ) . AsSpan ( ) ) [ 0 ] ;
5757 }
5858
59- // [Benchmark(Description = "Blake2Fast")]
60- // public void RunBlake2Fast()
61- // {
62- // Blake2b.ComputeHash(_data);
63- // }
59+ [ Benchmark ( Description = "Blake2Fast" ) ]
60+ public uint RunBlake2Fast ( )
61+ {
62+ return MemoryMarshal . Cast < byte , uint > ( Blake2b . ComputeHash ( _data ) ) [ 0 ] ;
63+ }
6464
65- //[Benchmark(Description = "SHA256")]
66- //public unsafe void RunSHA256()
67- //{
68- // Span<byte> data = stackalloc byte[32];
69- // System.Security.Cryptography.SHA256.HashData(_data.AsSpan(), data);
70- //}
65+ [ Benchmark ( Description = "SHA256" ) ]
66+ public unsafe uint RunSHA256 ( )
67+ {
68+ Span < byte > data = stackalloc byte [ 32 ] ;
69+ System . Security . Cryptography . SHA256 . HashData ( _data . AsSpan ( ) , data ) ;
70+ return MemoryMarshal . Cast < byte , uint > ( data ) [ 0 ] ;
71+ }
7172
7273 static void Main ( string [ ] args )
7374 {
You can’t perform that action at this time.
0 commit comments