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)
| 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 |
nothing calls this directly
no test coverage detected