Java Hash String hash(String s, int start, int end)

Here you can find the source of hash(String s, int start, int end)

Description

hash

License

Open Source License

Declaration

public static long hash(String s, int start, int end) 

Method Source Code

//package com.java2s;

public class Main {

    public static long hash(String s, int start, int end) {
        if (start < 0) {
            start = 0;/*from   ww w .ja  va2s  .  co  m*/
        }
        if (end > s.length()) {
            end = s.length();
        }
        long h = 0;
        for (int i = start; i < end; ++i) {
            h = (h << 5) - h + s.charAt(i);
        }
        return h;
    }
}

Related

  1. hash(String data)
  2. hash(String name)
  3. hash(String password)
  4. hash(String s)
  5. hash(String s)
  6. hash(String src)
  7. hash(String str, int max)
  8. hash(String str, int offset)
  9. hash(String string)