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


C# System.Security.Cryptography.MD5CryptoServiceProvider.ToHexString方法代码示例

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


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

示例1: __startMovie

        public void __startMovie(string pathName)
        {
            var f = new FileInfo(pathName);

            // let zmovies know we started a video. could we stream it to chrome?
            Console.WriteLine("startMovie " + new { f.Name });

            // lets shell and do a ls to figure out we do have the thumbnail there...
            var mp4_jpg = (
              from pf in new DirectoryInfo("/sdcard/oculus/360Photos/").GetFiles()
              //where pf.Extension.ToLower() == ".jpg"
              //  Z:\jsc.svn\examples\rewrite\GearVR360VideoPush\GearVR360VideoPush\Program.cs
              where pf.Name == System.IO.Path.ChangeExtension(f.Name, ".jpg")
              select pf

              // if we change it. can we hotswap the code already rnning in vr?
            ).FirstOrDefault();

            ///System.Console(30077): 757d:0001 startMovie { Name = 360 3D Towering Hoodoos in Bryce Canyon in 3d,  -degree video. by Visit_Utah.mp3._TB.mp4 }
            ///System.Console(30077): 757d:0001 startMovie { mp4_jpg = ScriptCoreLib.Shared.B[email protected]6d1507a }

            // https://sites.google.com/a/jsc-solutions.net/work/knowledge-base/15-dualvr/20160103/x360videoui
            Console.WriteLine("startMovie " + new { mp4_jpg });


            // upstream it!

            #region udp
            if (mp4_jpg != null)
            {

                Task.Run(
                    delegate
                    {

                        //args.filesize = mp4_jpg.Length;

                        // we are not on ui thread.
                        // HUD thread can freeze...
                        // mmap?
                        var sw = System.Diagnostics.Stopwatch.StartNew();
                        var bytes = File.ReadAllBytes(mp4_jpg.FullName);

                        // why slo slow???
                        // can jsc do it in NDK?
                        // http://stackoverflow.com/questions/32269305/android-play-pcm-byte-array-from-converted-from-base64-string-slow-sounds
                        var md5 = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(bytes);
                        var md5string = md5.ToHexString();

                        Console.WriteLine("startMovie " + new { f.Name, md5string, sw.ElapsedMilliseconds });


                        //I/System.Console( 4098): 1002:0001 startMovie { Name = 360 3D [3D  VR] __________(HAC) ______ __(Dance) A_ by _____________Verest__360_VR.mp3._TB.mp4 }
                        //I/System.Console( 4098): 1002:0001 startMovie { mp4_jpg = { FullName = /storage/emulated/legacy/oculus/360Photos/360 3D [3D  VR] __________(HAC) ______ __(Dance) A_ by _____________Verest__360_VR.mp3._TB.jpg, Exists = true } }
                        //I/System.Console( 4098): 1002:06a2 startMovie { Name = 360 3D [3D  VR] __________(HAC) ______ __(Dance) A_ by _____________Verest__360_VR.mp3._TB.mp4, md5string = 8bebab806331b078b385e33e5e069393, ElapsedMilliseconds = 6579 }


                        if (startMovieLookup.ContainsKey(md5string))
                        {
                            // already uploaded.

                            return;

                        }

                        startMovieLookup[md5string] = pathName;

                        // await for callback. lookup. transaction




                        // now broadcast. at 500KBps in segments.
                        // 8MB is 16 segments then.

                        if (bytes.Length > 0)
                            NetworkInterface.GetAllNetworkInterfaces().WithEach(
                                  n =>
                                  {
                                      // X:\jsc.svn\examples\java\android\forms\FormsUDPJoinGroup\FormsUDPJoinGroup\ApplicationControl.cs
                                      // X:\jsc.svn\core\ScriptCoreLibJava\BCLImplementation\System\Net\NetworkInformation\NetworkInterface.cs

                                      var IPProperties = n.GetIPProperties();
                                      var PhysicalAddress = n.GetPhysicalAddress();



                                      foreach (var ip in IPProperties.UnicastAddresses)
                                      {
                                          // ipv4
                                          if (ip.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)
                                          {
                                              if (!IPAddress.IsLoopback(ip.Address))
                                                  if (n.SupportsMulticast)
                                                  {
                                                      //fWASDC(ip.Address);
                                                      //fParallax(ip.Address);
                                                      //fvertexTransform(ip.Address);
                                                      //sendTracking(ip.Address);

//.........这里部分代码省略.........
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:ApplicationActivity.startMovie.cs

示例2: Application


//.........这里部分代码省略.........
                      var HUD = new IHTMLPre { "awaiting segment0..." }.AttachTo(toolbar);

                      // 500000

                      var uu = new UdpClient(49000);

                      //uu.ExclusiveAddressUse = false;
                      var md5string = "";

                      uu.JoinMulticastGroup(IPAddress.Parse("239.1.2.3"));
                      while (true)
                      {
                          var data = await uu.ReceiveAsync(); // did we jump to ui thread?

                          // jpeg progressive?
                          segment0 = data.Buffer;
                          file.Write(segment0, 0, segment0.Length);

                          // if segment is less than 65507
                          // then download is complete

                          if (file.Length > 0)
                              if (segment0.Length < 65507)
                              {

                                  //lobal::System.Security.Cryptography.MD5CryptoServiceProvider

                                  var bytes = file.ToArray();


                                  var md5 = new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(bytes);

                                  // https://sites.google.com/a/jsc-solutions.net/work/knowledge-base/15-dualvr/20160103/x360videoui
                                  md5string = md5.ToHexString();


                                  // this is slow.. worker?
                                  file64 = Convert.ToBase64String(bytes);

                                  //data:[<MIME-type>][;charset=<encoding>][;base64],

                                  file = new MemoryStream();
                                  var src = "data:image/jpeg;base64," + file64;
                                  new { }.With(
                                      async delegate
                                      {
                                          var img = new IHTMLImage { src = src, title = md5string }.AttachTo(toolbar);
                                          img.style.height = "6em";

                                          do
                                          {
                                              // send udp back. so vr knows which image we went back to?

                                              mesh.material.map.image = img;
                                              mesh.material.map.needsUpdate = true;

                                              await img.async.onclick;

                                              //send sha1
                                              UDPClipboardSend(md5);
                                          }
                                          while (true);
                                      }
                                  );

开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:65,代码来源:Application.cs


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