当前位置: 首页>>代码示例>>C#>>正文


C# UInt32.RotateLeft方法代码示例

本文整理汇总了C#中System.UInt32.RotateLeft方法的典型用法代码示例。如果您正苦于以下问题:C# UInt32.RotateLeft方法的具体用法?C# UInt32.RotateLeft怎么用?C# UInt32.RotateLeft使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.UInt32的用法示例。


在下文中一共展示了UInt32.RotateLeft方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PostProcess

        private static void PostProcess(ref UInt32 h, UInt32[] initValues, int dataCount, byte[] remainder)
        {
            if (dataCount >= 16)
            {
                h = initValues[0].RotateLeft(1) + 
                    initValues[1].RotateLeft(7) + 
                    initValues[2].RotateLeft(12) + 
                    initValues[3].RotateLeft(18);
            }


            h += (UInt32) dataCount;

            if (remainder != null)
            {
                // In 4-byte chunks, process all process all full chunks
                for (int x = 0; x < remainder.Length / 4; ++x)
                {
                    h += BitConverter.ToUInt32(remainder, x * 4) * _primes32[2];
                    h  = h.RotateLeft(17) * _primes32[3];
                }


                // Process last 4 bytes in 1-byte chunks (only runs if data.Length % 4 != 0)
                for (int x = remainder.Length - (remainder.Length % 4); x < remainder.Length; ++x)
                {
                    h += (UInt32) remainder[x] * _primes32[4];
                    h  = h.RotateLeft(11) * _primes32[0];
                }
            }

            h ^= h >> 15;
            h *= _primes32[1];
            h ^= h >> 13;
            h *= _primes32[2];
            h ^= h >> 16;
        }
开发者ID:PragmaticIT,项目名称:Data.HashFunction,代码行数:37,代码来源:xxHash.cs

示例2: ProcessGroup

        private static void ProcessGroup(ref UInt32 h1, byte[] dataGroup, int position, int length)
        {
            for (var x = position; x < position + length; x += 4)
            {
                UInt32 k1 = BitConverter.ToUInt32(dataGroup, x);

                k1 *= c1_32;
                k1 = k1.RotateLeft(15);
                k1 *= c2_32;

                h1 ^= k1;
                h1 = h1.RotateLeft(13);
                h1 = (h1 * 5) + 0xe6546b64;
            }
        }
开发者ID:PragmaticIT,项目名称:Data.HashFunction,代码行数:15,代码来源:MurmurHash3.cs

示例3: Final

        private static void Final(ref UInt32 a, ref UInt32 b, ref UInt32 c)
        {
            c ^= b; c -= b.RotateLeft(14);
            a ^= c; a -= c.RotateLeft(11);
            b ^= a; b -= a.RotateLeft(25);

            c ^= b; c -= b.RotateLeft(16);
            a ^= c; a -= c.RotateLeft( 4);
            b ^= a; b -= a.RotateLeft(14);

            c ^= b; c -= b.RotateLeft(24);
        }
开发者ID:PragmaticIT,项目名称:Data.HashFunction,代码行数:12,代码来源:JenkinsLookup3.cs

示例4: II

        private void II(ref UInt32 a, UInt32 b, UInt32 c,
                            UInt32 d, UInt32 x, SS s, UInt32 ac
                        )
        {
            unchecked
            {
#if !XX_inOneInstruction
                a += I(b, c, d) + x + ac;
                a = a.RotateLeft((int)s);
                a += b;
#else
				a = (a += I(b, c, d) + x + ac).RotateLeft((int)s) + b;
#endif
            }
        }
开发者ID:kirillbeldyaga,项目名称:Labs,代码行数:15,代码来源:MD3.cs

示例5: Mix

        private static void Mix(ref UInt32 a, ref UInt32 b, ref UInt32 c)
        {
            a -= c; a ^= c.RotateLeft( 4); c += b;
            b -= a; b ^= a.RotateLeft( 6); a += c;
            c -= b; c ^= b.RotateLeft( 8); b += a;

            a -= c; a ^= c.RotateLeft(16); c += b;
            b -= a; b ^= a.RotateLeft(19); a += c;
            c -= b; c ^= b.RotateLeft( 4); b += a;
        }
开发者ID:PragmaticIT,项目名称:Data.HashFunction,代码行数:10,代码来源:JenkinsLookup3.cs


注:本文中的System.UInt32.RotateLeft方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。