Java Hash String hashCode64(String s)

Here you can find the source of hashCode64(String s)

Description

Generate a 64 bit hash code for the specified string

License

Open Source License

Parameter

Parameter Description
s a parameter

Declaration

public static long hashCode64(String s) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from w ww.j  av a 2 s .c o m*/
     * Generate a 64 bit hash code for the specified string
     * @param s
     * @return
     */
    public static long hashCode64(String s) {
        long h = 0;
        if (s != null && s.length() > 0) {
            int off = 0;
            int len = s.length();
            for (int i = 0; i < len; i++) {
                h = 31 * h + s.charAt(off++);
            }
        }
        return h;
    }
}

Related

  1. hashCode(String sIn)
  2. hashCode(String str)
  3. hashCode1(String str)
  4. hashCode2(String str)
  5. hashCode64(String s)
  6. hashCodeIgnoreCase(String a)
  7. hashCodeOfStringArray(String[] stringArray)
  8. hashCodeToString(byte[] hash)
  9. hashCodeToString(long code)