Java Hash String hashCode2(String str)

Here you can find the source of hashCode2(String str)

Description

hash Code

License

Apache License

Declaration

public static long hashCode2(String str) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static long hashCode2(String str) {
        long h = 1125899906842597L; // prime
        int len = str.length();

        for (int i = 0; i < len; i++) {
            h = 31 * h + str.charAt(i);//w  ww.  java2  s  . co  m
        }
        return h;
    }
}

Related

  1. hashcode(String name)
  2. hashCode(String s)
  3. hashCode(String sIn)
  4. hashCode(String str)
  5. hashCode1(String str)
  6. hashCode64(String s)
  7. hashCode64(String s)
  8. hashCodeIgnoreCase(String a)
  9. hashCodeOfStringArray(String[] stringArray)