public void Tests() { var crc = new Crc32(); Assert.AreEqual(0, crc.Value); crc.Update(145); Assert.AreEqual(1426738271, crc.Value); crc.Update(123456789); Assert.AreEqual(1147030863, crc.Value); var data = new byte[] { 145, 234, 156 }; crc.Update(data); Assert.AreEqual(3967437022, crc.Value); }
public PackOutputStream(Stream stream) { _crc = new Crc32(); _md = Constants.newMessageDigest(); _stream = stream; }
public IndexPack(Repository db, Stream src, FileInfo dstBase) { _repo = db; _stream = src; _crc = new Crc32(); _inflater = InflaterCache.Instance.get(); _windowCursor = new WindowCursor(); _buffer = new byte[BUFFER_SIZE]; _objectData = new byte[BUFFER_SIZE]; _objectDigest = Constants.newMessageDigest(); _tempObjectId = new MutableObjectId(); _packDigest = Constants.newMessageDigest(); if (dstBase != null) { DirectoryInfo dir = dstBase.Directory; string nam = dstBase.Name; _dstPack = new FileInfo(Path.Combine(dir.ToString(), GetPackFileName(nam))); _dstIdx = new FileInfo(Path.Combine(dir.ToString(), GetIndexFileName(nam))); _packOut = _dstPack.Create(); } else { _dstPack = null; _dstIdx = null; } }
public CheckedOutputStream(Stream under, Crc32 crc) { this.under = under; this.crc = crc; }