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


C# UInt32.CopyTo方法代码示例

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


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

示例1: Decrypt

 private static UInt32[] Decrypt(UInt32[] v, UInt32[] k)
 {
     Int32 n = v.Length - 1;
     if (n < 1) {
         return v;
     }
     if (k.Length < 4) {
         UInt32[] Key = new UInt32[4];
         k.CopyTo(Key, 0);
         k = Key;
     }
     UInt32 z = v[n], y = v[0], sum, e;
     Int32 p, q = 6 + 52 / (n + 1);
     unchecked {
         sum = (UInt32)(q * delta);
         while (sum != 0) {
             e = sum >> 2 & 3;
             for (p = n; p > 0; p--) {
                 z = v[p - 1];
                 y = v[p] -= (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
             }
             z = v[n];
             y = v[0] -= (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z);
             sum -= delta;
         }
     }
     return v;
 }
开发者ID:bluelovers,项目名称:phprpc,代码行数:28,代码来源:XXTEA.cs

示例2: Encrypt

 private static UInt32[] Encrypt(UInt32[] v, UInt32[] k)
 {
     Int32 n = v.Length - 1;
     if (n < 1)
     {
         return v;
     }
     if (k.Length < 4)
     {
         UInt32[] Key = new UInt32[4];
         k.CopyTo(Key, 0);
         k = Key;
     }
     UInt32 z = v[n], y = v[0], delta = 0x9E3779B9, sum = 0, e;
     Int32 p, q = 6 + 52 / (n + 1);
     while (q-- > 0)
     {
         sum = unchecked(sum + delta);
         e = sum >> 2 & 3;
         for (p = 0; p < n; p++)
         {
             y = v[p + 1];
             z = unchecked(v[p] += (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
         }
         y = v[0];
         z = unchecked(v[n] += (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
     }
     return v;
 }
开发者ID:byronv5,项目名称:CKMobile,代码行数:29,代码来源:XXtea.cs

示例3: Decrypt

        private static UInt32[] Decrypt(UInt32[] v, UInt32[] k)
        {
            Int32 n = v.Length - 1;
            if (n < 1)
            {
                return v;
            }
            if (k.Length < 4)
            {
                var key = new UInt32[4];
                k.CopyTo(key, 0);
                k = key;
            }
            UInt32 y = v[0];

            Int32 q = 6 + 52 / (n + 1);
            var sum = unchecked((UInt32)(q * mDelta));
            while (sum != 0)
            {
                UInt32 e = sum >> 2 & 3;
                UInt32 z;
                Int32 p;
                for (p = n; p > 0; p--)
                {
                    z = v[p - 1];
                    y = unchecked(v[p] -= (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
                }
                z = v[n];
                y = unchecked(v[0] -= (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
                sum = unchecked(sum - mDelta);
            }
            return v;
        }
开发者ID:fjz13,项目名称:Medusa,代码行数:33,代码来源:XXTEA.cs

示例4: Encrypt

        private static UInt32[] Encrypt(UInt32[] v, UInt32[] k)
        {
            Int32 n = v.Length - 1;
            if (n < 1)
            {
                return v;
            }
            if (k.Length < 4)
            {
                var key = new UInt32[4];
                k.CopyTo(key, 0);
                k = key;
            }
            UInt32 z = v[n];

            UInt32 sum = 0;
            Int32 q = 6 + 52 / (n + 1);
            while (q-- > 0)
            {
                sum = unchecked(sum + mDelta);
                UInt32 e = sum >> 2 & 3;
                UInt32 y;
                Int32 p;
                for (p = 0; p < n; p++)
                {
                    y = v[p + 1];
                    z = unchecked(v[p] += (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
                }
                y = v[0];
                z = unchecked(v[n] += (z >> 5 ^ y << 2) + (y >> 3 ^ z << 4) ^ (sum ^ y) + (k[p & 3 ^ e] ^ z));
            }
            return v;
        }
开发者ID:fjz13,项目名称:Medusa,代码行数:33,代码来源:XXTEA.cs

示例5: load

        //clark 2011.3.23
        public rfid.Constants.Result load(
            rfid.Linkage transport,
            UInt32       readerHandle
        )
        {
            UInt32[ ] tmpBuf = new UInt32[ OEMCFG_AREA_MAP_SIZE_WORDS ];
            rfid.Constants.Result Result = rfid.Constants.Result.OK;

            Array.Clear(tmpBuf, 0, tmpBuf.Length);

            //MacReadOemData only load one ome at one time. load all ome to buf.
            for (ushort index = 0; index < OEMCFG_AREA_MAP_SIZE_WORDS; index++)
            {
                Result = transport.API_MacReadOemData(index,
                                                      ref tmpBuf[index]);

                if (rfid.Constants.Result.OK != Result)
                    return Result;
            }

            tmpBuf.CopyTo(oemDataBuffer, 0);

            return Result;
        }
开发者ID:mti-rfid,项目名称:RFID_Explorer,代码行数:25,代码来源:Source_OEMData.cs


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