File tree Expand file tree Collapse file tree 2 files changed +11
-26
lines changed
Expand file tree Collapse file tree 2 files changed +11
-26
lines changed Original file line number Diff line number Diff line change 44
55### Fixes
66
7+ - Fix UWP Net Native compilation ([ #4085 ] ( https://github.com/getsentry/sentry-dotnet/pull/4085 ) )
78- Sentry Java SDK dependencies are now detected and included in the Android bindings ([ #4079 ] ( https://github.com/getsentry/sentry-dotnet/pull/4079 ) )
89
910## 5.5.0
Original file line number Diff line number Diff line change @@ -5,39 +5,23 @@ namespace Sentry.Internal;
55///
66/// See https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV_hash_parameters
77/// </summary>
8- /// <remarks>
9- /// We use a struct to avoid heap allocations.
10- /// </remarks>
11- internal struct FnvHash
8+ internal static class FnvHash
129{
13- public FnvHash ( )
14- {
15- }
16-
1710 private const int Offset = unchecked ( ( int ) 2166136261 ) ;
1811 private const int Prime = 16777619 ;
1912
20- private int HashCode { get ; set ; } = Offset ;
21-
22- private void Combine ( byte data )
23- {
24- unchecked
25- {
26- HashCode ^= data ;
27- HashCode *= Prime ;
28- }
29- }
30-
31- private static int ComputeHash ( byte [ ] data )
13+ internal static int ComputeHash ( string input )
3214 {
33- var result = new FnvHash ( ) ;
34- foreach ( var b in data )
15+ var hashCode = Offset ;
16+ foreach ( var b in Encoding . UTF8 . GetBytes ( input ) )
3517 {
36- result . Combine ( b ) ;
18+ unchecked
19+ {
20+ hashCode ^= b ;
21+ hashCode *= Prime ;
22+ }
3723 }
3824
39- return result . HashCode ;
25+ return hashCode ;
4026 }
41-
42- public static int ComputeHash ( string data ) => ComputeHash ( Encoding . UTF8 . GetBytes ( data ) ) ;
4327}
You can’t perform that action at this time.
0 commit comments