public SignatureBuilder(IHashAlgorithm hashAlgorithm, IRollingChecksum rollingChecksumAlgorithm) { HashAlgorithm = hashAlgorithm; RollingChecksumAlgorithm = rollingChecksumAlgorithm; ChunkSize = DefaultChunkSize; ProgressReport = null; }
public Signature(IHashAlgorithm hashAlgorithm, IRollingChecksum rollingChecksumAlgorithm, short chunkSize) { HashAlgorithm = hashAlgorithm; RollingChecksumAlgorithm = rollingChecksumAlgorithm; Chunks = new List <ChunkSignature>(); ChunkSize = chunkSize; }
public DeltaGenerator(IRollingChecksum checksumProvider, IHashAlgorithm hashProvider) { if (checksumProvider == null) throw new ArgumentNullException("checksumProvider"); if (hashProvider == null) throw new ArgumentNullException("hashProvider"); _initialized = false; ChecksumProvider = checksumProvider; HashProvider = hashProvider; }
public void WriteMetadata(IHashAlgorithm hashAlgorithm, IRollingChecksum rollingChecksumAlgorithm) { signatureStream.Write(BinaryFormat.SignatureHeader); signatureStream.Write(BinaryFormat.Version); signatureStream.Write(hashAlgorithm.Name); signatureStream.Write(rollingChecksumAlgorithm.Name); signatureStream.Write(BinaryFormat.EndOfMetadata); }
public void WriteMetadata(IHashAlgorithm hashAlgorithm, IRollingChecksum rollingChecksumAlgorithm, byte[] hash) { signatureStream.Write(BinaryFormat.SignatureHeader); signatureStream.Write(BinaryFormat.Version); signatureStream.Write(hashAlgorithm.Name); signatureStream.Write(rollingChecksumAlgorithm.Name); signatureStream.Write(BinaryFormat.EndOfMetadata); }
public HashBlockGenerator(IRollingChecksum checksumProvider, IHashAlgorithm hashProvider, int blockSize) { if (checksumProvider == null) throw new ArgumentNullException("checksumProvider"); if (hashProvider == null) throw new ArgumentNullException("hashProvider"); if (blockSize <= 0) throw new ArgumentException("blockSize must be greater than zero"); ChecksumProvider = checksumProvider; HashAlgorithm = hashProvider; _blockSize = blockSize; }
public DeltaGenerator(IRollingChecksum checksumProvider, IHashAlgorithm hashProvider) { if (checksumProvider == null) { throw new ArgumentNullException("checksumProvider"); } if (hashProvider == null) { throw new ArgumentNullException("hashProvider"); } _initialized = false; ChecksumProvider = checksumProvider; HashProvider = hashProvider; }
public HashBlockGenerator(IRollingChecksum checksumProvider, IHashAlgorithm hashProvider, int blockSize) { if (checksumProvider == null) { throw new ArgumentNullException("checksumProvider"); } if (hashProvider == null) { throw new ArgumentNullException("hashProvider"); } if (blockSize <= 0) { throw new ArgumentException("blockSize must be greater than zero"); } ChecksumProvider = checksumProvider; HashAlgorithm = hashProvider; _blockSize = blockSize; }
public OctodiffSignatureBuilder(IHashAlgorithm hashAlgorithm, IRollingChecksum rollingChecksumAlgorithm) { HashAlgorithm = hashAlgorithm; RollingChecksumAlgorithm = rollingChecksumAlgorithm; ChunkSize = DefaultChunkSize; }
public Signature(IHashAlgorithm hashAlgorithm, IRollingChecksum rollingChecksumAlgorithm) { HashAlgorithm = hashAlgorithm; RollingChecksumAlgorithm = rollingChecksumAlgorithm; Chunks = new List<ChunkSignature>(); }
public OctodiffSignature(IHashAlgorithm hashAlgorithm, IRollingChecksum rollingChecksumAlgorithm) { HashAlgorithm = hashAlgorithm; RollingChecksumAlgorithm = rollingChecksumAlgorithm; Chunks = new List <ChunkSignature>(); }
public static void ValidateSignature(Stream signatureStream, IHashAlgorithm hashAlgorithm, string baseFileHash, IRollingChecksum rollingAlgorithm) { signatureStream.Seek(0, SeekOrigin.Begin); var sig = new SignatureReader(signatureStream, null).ReadSignature(); Assert.AreEqual(RsyncFormatType.FastRsync, sig.Type); Assert.AreEqual(hashAlgorithm.Name, sig.HashAlgorithm.Name); Assert.AreEqual(hashAlgorithm.Name, sig.Metadata.ChunkHashAlgorithm); Assert.AreEqual(hashAlgorithm.HashLength, sig.HashAlgorithm.HashLength); Assert.AreEqual(rollingAlgorithm.Name, sig.RollingChecksumAlgorithm.Name); Assert.AreEqual(rollingAlgorithm.Name, sig.Metadata.RollingChecksumAlgorithm); Assert.AreEqual("MD5", sig.Metadata.BaseFileHashAlgorithm); Assert.AreEqual(baseFileHash, sig.Metadata.BaseFileHash); }