MCPcopy Create free account
hub / github.com/antlr/codebuff / concatenating

Method concatenating

output/java_guava/1.4.18/Hashing.java:675–684  ·  view source on GitHub ↗

Returns a hash function which computes its hash code by concatenating the hash codes of the underlying hash functions together. This can be useful if you need to generate hash codes of a specific length. For example, if you need 1024-bit hash codes, you could join two Hashing#sha512 hash

(HashFunction first, HashFunction second, HashFunction... rest)

Source from the content-addressed store, hash-verified

673
674
675 public static HashFunction concatenating(HashFunction first, HashFunction second, HashFunction... rest) {
676 // We can't use Lists.asList() here because there's no hash->collect dependency
677 List<HashFunction> list = new ArrayList<HashFunction>();
678 list.add(first);
679 list.add(second);
680 for (HashFunction hashFunc : rest) {
681 list.add(hashFunc);
682 }
683 return new ConcatenatedHashFunction(list.toArray(new HashFunction[0]));
684 }
685
686 /**
687 * Returns a hash function which computes its hash code by concatenating the hash codes of the

Callers

nothing calls this directly

Calls 5

addMethod · 0.65
sizeMethod · 0.65
toArrayMethod · 0.45
checkNotNullMethod · 0.45
checkArgumentMethod · 0.45

Tested by

no test coverage detected