package org.krugler.yalder;


public class CharUtils {

    /**
     * Return hash value for <key>
     * 
     * @param key
     * @return
     */
    public static int joaat_hash(CharSequence key) {
        int hash = 0;
        
        for (int i = 0; i < key.length(); i++) {
            int c = (int)key.charAt(i);
            hash += c;
            hash += (hash << 10);
            hash ^= (hash >>> 6);
        }
        
        return conditionHash(hash);
    }

    public static int joaat_hash(char[] text, int offset, int length) {
        int hash = 0;
        
        for (int i = 0; i < length; i++) {
            int c = (int)text[offset + i];
            hash += c;
            hash += (hash << 10);
            hash ^= (hash >>> 6);
        }
        
        return conditionHash(hash);
    }

    private static int conditionHash(int hash) {
        hash += (hash << 3);
        hash ^= (hash >>> 11);
        hash += (hash << 15);
        
        return hash;
    }

}

@@ -87,19 +87,52 @@
 ue for %3C
-key
+text%3E, for %3Clength%3E chars at %3Coffset
 %3E%0A     *
@@ -147,19 +147,20 @@
  @param 
-key
+text
 %0A     * 
@@ -164,348 +164,84 @@
  * @
-return%0A     */%0A    public static int joaat_hash(CharSequence key) %7B%0A        int hash = 0;%0A        %0A        for (int i = 0; i %3C key.length(); i++) %7B%0A            int c = (int)key.charAt(i);%0A            hash += c;%0A            hash += (hash %3C%3C 10);%0A            hash %5E= (hash %3E%3E%3E 6);%0A        %7D%0A        %0A        return conditionHash(hash);
+param offset%0A     * @param length%0A     * @return hash of characters.
 %0A    
-%7D%0A
+ */
 %0A   
@@ -540,100 +540,8 @@
    %0A
-        return conditionHash(hash);%0A    %7D%0A%0A    private static int conditionHash(int hash) %7B%0A
     
@@ -663,10 +663,11 @@
 %0A    %7D%0A%0A
+%0A
 %7D%0A

Remove unused code