Package com.fathomdb.hash

Examples of com.fathomdb.hash.Sha1Hash


  public static Sha1Hash sha1(byte[] plainText) {
    MessageDigest digest = getThreadLocalSha1();

    byte[] hash = digest.digest(plainText);
    return new Sha1Hash(hash);
  }
View Full Code Here


  public static Sha1Hash sha1(String a) {
    MessageDigest digest = getThreadLocalSha1();

    byte[] hash = digest.digest(toBytesUtf8(a));
    return new Sha1Hash(hash);
  }
View Full Code Here

  public static Sha1Hash sha1(byte[] buffer1, byte[] buffer2) {
    MessageDigest digest = getThreadLocalSha1();

    digest.update(buffer1);
    byte[] hash = digest.digest(buffer2);
    return new Sha1Hash(hash);
  }
View Full Code Here

  public static Sha1Hash sha1(String a, String b) {
    MessageDigest digest = getThreadLocalSha1();

    digest.update(toBytesUtf8(a));
    byte[] hash = digest.digest(toBytesUtf8(b));
    return new Sha1Hash(hash);
  }
View Full Code Here

    for (int i = 0; i < data.length - 1; i++) {
      digest.update(toBytesUtf8(data[i]));
    }

    byte[] hash = digest.digest(toBytesUtf8(data[data.length - 1]));
    return new Sha1Hash(hash);
  }
View Full Code Here

    MessageDigest digest = getThreadLocalSha1();

    digest.update(a);
    digest.update(b);
    byte[] hash = digest.digest(c);
    return new Sha1Hash(hash);
  }
View Full Code Here

    for (int i = 0; i < data.length - 1; i++) {
      digest.update(data[i]);
    }

    byte[] hash = digest.digest(data[data.length - 1]);
    return new Sha1Hash(hash);
  }
View Full Code Here

    }
  }

  public static Sha1Hash sha1(InputStream inputStream) throws IOException {
    MessageDigest digest = getThreadLocalSha1();
    return new Sha1Hash(hash(digest, inputStream).hash);
  }
View Full Code Here

    }
  }

  public static Sha1Hash sha1(File file) throws IOException {
    MessageDigest digest = getThreadLocalSha1();
    return new Sha1Hash(hash(digest, file).hash);
  }
View Full Code Here

TOP

Related Classes of com.fathomdb.hash.Sha1Hash

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.