Examples of Hasher


Examples of cascading.tuple.Hasher

    return false;
    }

  protected void initialize( Comparator defaultComparator, Comparator[] comparators )
    {
    Hasher defaultHasher = DEFAULT;

    if( defaultComparator instanceof Hasher )
      defaultHasher = (Hasher) defaultComparator;

    hashers = new Hasher[ comparators.length ];
View Full Code Here

Examples of com.boundlessgeo.geoserver.util.Hasher

    @Autowired
    public ImportController(GeoServer geoServer, Importer importer) {
        super(geoServer);
        this.importer = importer;
        this.hasher = new Hasher(7);
    }
View Full Code Here

Examples of com.cloudhopper.commons.util.Hasher

    private String getHashPathForLevel(String name, int levels)
    {
  String path = "";
  if (levels != 0) {
      try {
    Hasher hasher = new Hasher(Algorithm.MD5);
    String hash = hasher.toHashedHexString(name);
    path = "";
    for (int i = 1; i <= levels; i++) {
        path += hash.substring( 0, i ) + "/";
    }
      } catch (NoSuchAlgorithmException e) {}
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.guava.hash.Hasher

   * Hashes the contents of this byte source using the given hash function.
   *
   * @throws IOException if an I/O error occurs in the process of reading from this source
   */
  public HashCode hash(HashFunction hashFunction) throws IOException {
    Hasher hasher = hashFunction.newHasher();
    copyTo(Funnels.asOutputStream(hasher));
    return hasher.hash();
  }
View Full Code Here

Examples of com.findwise.tools.Hasher

  private Hasher hasher;

  @Override
  public void stageInit() throws RequiredArgumentMissingException {
    try {
      hasher = new Hasher(algorithm);
    } catch (NoSuchAlgorithmException e) {
      throw new RequiredArgumentMissingException("Specified algorithm does not exist", e);
    }
  }
View Full Code Here

Examples of com.google.common.hash.Hasher

    }

    @Override
    public String write(InputStream in) throws MicroKernelException {
        try {
            final Hasher hasher = Hashing.sha256().newHasher();
            Blob blob = store.createBlob(
                    new CheckedInputStream(in, new Checksum() {
                        @Override
                        public void update(byte[] b, int off, int len) {
                            hasher.putBytes(b, off, len);
                        }
                        @Override
                        public void update(int b) {
                            hasher.putByte((byte) b);
                        }
                        @Override
                        public void reset() {
                            throw new UnsupportedOperationException();
                        }
                        @Override
                        public long getValue() {
                            throw new UnsupportedOperationException();
                        }
                    }));
            HashCode hash = hasher.hash();

            // wrap into AbstractBlob for the SHA-256 memorization feature
            if (!(blob instanceof AbstractBlob)) {
                final Blob b = blob;
                blob = new AbstractBlob(hash) {
View Full Code Here

Examples of com.google.common.hash.Hasher

   * Hashes the contents of this byte source using the given hash function.
   *
   * @throws IOException if an I/O error occurs in the process of reading from this source
   */
  public HashCode hash(HashFunction hashFunction) throws IOException {
    Hasher hasher = hashFunction.newHasher();
    copyTo(Funnels.asOutputStream(hasher));
    return hasher.hash();
  }
View Full Code Here

Examples of com.google.common.hash.Hasher

    }

    @Override
    public int hashCode() {
        HashFunction hf = Hashing.goodFastHash(32);
        Hasher h = hf.newHasher();
        h.putInt(slots.size());
        for (int i=0; i<slots.size(); i++) {
            h.putInt(slots.get(i).size());
            for (int j=0; j<slots.size(); j++) {
                h.putBytes(slots.get(i).get(j).getLowerRange());
                h.putBytes(slots.get(i).get(j).getUpperRange());
            }
        }
        return h.hash().asInt();
    }
View Full Code Here

Examples of com.google.common.hash.Hasher

            log.info("/proc/cpuinfo file not found; won't include in machine signature");
        }

        Collections.sort(material);

        Hasher hasher = Hashing.md5().newHasher();
        for (String s : material) {
            hasher.putString(s);
            hasher.putByte((byte) 0);
        }

        return hostname + "_" + hasher.hash().toString();
    }
View Full Code Here

Examples of com.google.common.hash.Hasher

            // We need something that can be consistent
            // Some people say it's OK to just use the hash of the key,
            // but obviously there's no proof of that. We add a little
            // complexity
            // to be safer.
            Hasher hasher = Hashing.sha256().newHasher();
            byte[] passwordBytes = password.getBytes(Charsets.UTF_8);
            hasher.putBytes(passwordBytes);
            hasher.putBytes(aesBytes);
            hasher.putBytes(passwordBytes);
            hasher.putBytes(salt);
            hasher.putBytes(passwordBytes);
            hmacBytes = hasher.hash().asBytes();
        }
        if (hmacBytes.length != (256 / 8)) {
            throw new IllegalStateException();
        }
        try {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.