Java Hash Calculate hash(Object... value)

Here you can find the source of hash(Object... value)

Description

hash

Declaration

public static long hash(Object... value) 

Method Source Code

//package com.java2s;

public class Main {
    public static long hash(Object... value) {
        String key = toString(value);
        long hash;
        int i;/*ww w  .jav  a 2  s.c  o  m*/
        for (hash = key.length(), i = 0; i < key.length(); ++i)
            hash = (hash << 4) ^ (hash >> 28) ^ key.charAt(i);
        return hash;
    }

    private static String toString(Object... values) {
        StringBuilder sb = new StringBuilder();
        for (Object value : values) {
            sb.append(value.toString());
        }
        return sb.toString();
    }
}

Related

  1. hash(Object object)
  2. hash(Object v)
  3. hash(Object value)
  4. hash(Object value, int seed)
  5. hash(Object... as)
  6. hash(Object... values)
  7. hash(Object[] array)
  8. hash(Object[] array)
  9. hash(Object[] state)