Example usage for com.google.common.hash Hashing murmur3_128

List of usage examples for com.google.common.hash Hashing murmur3_128

Introduction

In this page you can find the example usage for com.google.common.hash Hashing murmur3_128.

Prototype

public static HashFunction murmur3_128() 

Source Link

Document

Returns a hash function implementing the <a href="http://smhasher.googlecode.com/svn/trunk/MurmurHash3.cpp"> 128-bit murmur3 algorithm, x64 variant</a> (little-endian variant), using a seed value of zero.

Usage

From source file:com.khannedy.sajikeun.servlet.Asset.java

public Asset(byte[] resource, long lastModified) {
    this.resource = resource;
    this.eTag = '"' + Hashing.murmur3_128().hashBytes(resource).toString() + '"';
    this.lastModified = lastModified;
}

From source file:io.dropwizard.sharding.sharding.impl.ConsistentHashBucketIdExtractor.java

@Override
public int bucketId(T id) {
    int hashKey = Hashing.murmur3_128().hashString(id.toString(), StandardCharsets.UTF_8).asInt();
    hashKey *= hashKey < 0 ? -1 : 1;/*from  w  ww. ja v  a2  s .c o  m*/

    return hashKey % (ShardManager.MAX_BUCKET + 1);
}

From source file:org.graylog.plugins.pipelineprocessor.functions.hashing.Murmur3_128.java

@Override
protected String getDigest(String value) {
    return Hashing.murmur3_128().hashString(value, StandardCharsets.UTF_8).toString();
}

From source file:com.ambimmort.rmr.client.Client.java

public synchronized void refresh() {
    connectionsPoints = null;//from ww w  . ja v  a 2  s.  c  om
    connectionsPoints = new ConsistentHash<Connection>(Hashing.murmur3_128(), cps.size(), cps);
}

From source file:org.elasticsoftware.elasticactors.cluster.HashingNodeSelector.java

public HashingNodeSelector(List<PhysicalNode> nodes) {
    final HashFunction hashFunction = Hashing.murmur3_128();
    consistentHash = new ConsistentHash<>(hashFunction, REPLICAS, nodes);
    allNodes = nodes;/*from  w ww . ja va  2 s.c o  m*/
}

From source file:ome.util.checksum.Murmur128ChecksumProviderImpl.java

public Murmur128ChecksumProviderImpl() {
    super(Hashing.murmur3_128());
}

From source file:org.greenrobot.essentials.hash.otherhashes.Murmur3fGuavaChecksum.java

@Override
public void reset() {
    hasher = Hashing.murmur3_128().newHasher();
}

From source file:epoxide.lpa.impl.memcachedb.MemcacheRecordSet.java

private String toKey(Object id) {
    return recdata.name + ">" + StringUtil.hash(Hashing.murmur3_128(), Serializer.INSTANCE.kryo(), id);
}

From source file:io.jwt.primer.util.TokenUtil.java

public static String refreshToken(final String app, final String id, final JwtConfig jwtConfig,
        final JsonWebToken token) {
    val hasher = Hashing.murmur3_128().newHasher();
    hasher.putString(app, Charsets.UTF_8);
    hasher.putString(id, Charsets.UTF_8);
    hasher.putLong(token.claim().expiration());
    hasher.putString(jwtConfig.getPrivateKey(), Charsets.UTF_8);
    return hasher.hash().toString();
}

From source file:com.github.benmanes.caffeine.cache.simulator.parser.umass.network.YoutubeTraceReader.java

@Override
public LongStream events() throws IOException {
    return lines().map(line -> line.split(" ")).filter(array -> array[3].equals("GETVIDEO"))
            .mapToLong(array -> Hashing.murmur3_128().hashUnencodedChars(array[4]).asLong());
}