コード例 #1
0
        public DBEntry(CTDBResponseEntry ctdbRespEntry)
        {
            this.syndrome = ctdbRespEntry.syndrome == null
                ? ParityToSyndrome.Parity2Syndrome(1, 1, 8, 8, Convert.FromBase64String(ctdbRespEntry.parity))
                : ParityToSyndrome.Bytes2Syndrome(1, Math.Min(AccurateRipVerify.maxNpar, ctdbRespEntry.npar), Convert.FromBase64String(ctdbRespEntry.syndrome));

            this.conf      = ctdbRespEntry.confidence;
            this.stride    = ctdbRespEntry.stride * 2;
            this.crc       = uint.Parse(ctdbRespEntry.crc32, NumberStyles.HexNumber);
            this.id        = ctdbRespEntry.id;
            this.toc       = CDImageLayout.FromString(ctdbRespEntry.toc);
            this.hasParity = ctdbRespEntry.hasparity;
            if (ctdbRespEntry.trackcrcs != null)
            {
                var crcs = ctdbRespEntry.trackcrcs.Split(' ');
                if (crcs.Length == this.toc.AudioTracks)
                {
                    this.trackcrcs = new uint[crcs.Length];
                    for (int i = 0; i < this.trackcrcs.Length; i++)
                    {
                        this.trackcrcs[i] = uint.Parse(crcs[i], NumberStyles.HexNumber);
                    }
                }
            }
        }
コード例 #2
0
ファイル: DBEntry.cs プロジェクト: androidhacker/DotNetProjs
 public DBEntry(CTDBResponseEntry ctdbRespEntry)
 {
     this.syndrome = ctdbRespEntry.syndrome == null
         ? ParityToSyndrome.Parity2Syndrome(1, 1, 8, 8, Convert.FromBase64String(ctdbRespEntry.parity))
         : ParityToSyndrome.Bytes2Syndrome(1, Math.Min(AccurateRipVerify.maxNpar, ctdbRespEntry.npar), Convert.FromBase64String(ctdbRespEntry.syndrome));
     this.conf = ctdbRespEntry.confidence;
     this.stride = ctdbRespEntry.stride * 2;
     this.crc = uint.Parse(ctdbRespEntry.crc32, NumberStyles.HexNumber);
     this.id = ctdbRespEntry.id;
     this.toc = CDImageLayout.FromString(ctdbRespEntry.toc);
     this.hasParity = ctdbRespEntry.hasparity;
     if (ctdbRespEntry.trackcrcs != null)
     {
         var crcs = ctdbRespEntry.trackcrcs.Split(' ');
         if (crcs.Length == this.toc.AudioTracks)
         {
             this.trackcrcs = new uint[crcs.Length];
             for (int i = 0; i < this.trackcrcs.Length; i++)
             {
                 this.trackcrcs[i] = uint.Parse(crcs[i], NumberStyles.HexNumber);
             }
         }
     }
 }