Package com.ettrema.zsync

Examples of com.ettrema.zsync.SHA1


   */
  //@Test
  public void test_LocalOnly() throws FileNotFoundException, Exception {
    System.out.println("--------------------- test1 -----------------------");
    System.out.println("source file: " + fIn.getAbsolutePath());
    SHA1 sha = new SHA1(fIn);
    String actual = sha.SHA1sum();
    System.out.println("checksum of source file: " + actual + " - length: " + fIn.length());

    File metaFile = metaFileMaker.make("/test", 32, fIn);
    System.out.println("generated meta file: " + metaFile.getAbsolutePath());
    LocalFileRangeLoader rangeLoader = new LocalFileRangeLoader(fIn);
View Full Code Here


     * Method builds header from key values
     * @return Full header in String format
     */
    public Headers getFullHeader(File file, String url, int blocksize, int[] hashLengths){
    Headers h = new Headers()
        String sha1 = new SHA1(file.toString()).SHA1sum();   
    if( url == null ) {
      url = file.getName();         
    }
        if (!isPowerOfTwo(blocksize)) {
            throw new IllegalArgumentException("Blocksize must be a power of 2 (512, 1024, 2048, ...)");
View Full Code Here

TOP

Related Classes of com.ettrema.zsync.SHA1

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.