Summary

Class:System.Numerics.Hashing.HashHelpers
Assembly:System.Memory
File(s):C:\GitHub\corefx\src\Common\src\System\Numerics\Hashing\HashHelpers.cs
Covered lines:5
Uncovered lines:1
Coverable lines:6
Total lines:22
Line coverage:83.3%

Metrics

MethodCyclomatic complexity NPath complexity Sequence coverage Branch coverage
Combine(...)10100100
.cctor()1000

File(s)

C:\GitHub\corefx\src\Common\src\System\Numerics\Hashing\HashHelpers.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3// See the LICENSE file in the project root for more information.
 4
 5namespace System.Numerics.Hashing
 6{
 7    internal static class HashHelpers
 8    {
 09        public static readonly int RandomSeed = Guid.NewGuid().GetHashCode();
 10
 11        public static int Combine(int h1, int h2)
 112        {
 13            unchecked
 114            {
 15                // RyuJIT optimizes this to use the ROL instruction
 16                // Related GitHub pull request: dotnet/coreclr#1830
 117                uint rol5 = ((uint)h1 << 5) | ((uint)h1 >> 27);
 118                return ((int)rol5 + h1) ^ h2;
 19            }
 120        }
 21    }
 22}