Java Hash String hashCode1(String str)

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

Description

hash Code

License

Apache License

Declaration

public static long hashCode1(String str) 

Method Source Code

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

public class Main {
    public static long hashCode1(String str) {
        long hash = 0;
        long x = 0;
        for (int i = 0; i < str.length(); i++) {
            hash = (hash << 4) + str.charAt(i);
            if ((x = hash & 0xF0000000L) != 0) {
                hash ^= (x >> 24);
                hash &= ~x;/* w w w.j  av a2 s .  c  o m*/
            }
        }
        return (hash & 0x7FFFFFFF);
    }
}

Related

  1. hashbang(final String historyToken)
  2. hashcode(String name)
  3. hashCode(String s)
  4. hashCode(String sIn)
  5. hashCode(String str)
  6. hashCode2(String str)
  7. hashCode64(String s)
  8. hashCode64(String s)
  9. hashCodeIgnoreCase(String a)