improved sql parser.

This commit is contained in:
wenshao
2017-11-06 16:58:58 +08:00
parent d94b773de9
commit d6e9cfbd4f
14 changed files with 255 additions and 20 deletions
@@ -134,6 +134,38 @@ public final class FnvHash {
return hashCode;
}
public static long fnv1a_64_lower(StringBuilder key) {
long hashCode = BASIC;
for (int i = 0; i < key.length(); ++i) {
char ch = key.charAt(i);
if (ch >= 'A' && ch <= 'Z') {
ch = (char) (ch + 32);
}
hashCode ^= ch;
hashCode *= PRIME;
}
return hashCode;
}
public static long fnv1a_64_lower(long basic, StringBuilder key) {
long hashCode = basic;
for (int i = 0; i < key.length(); ++i) {
char ch = key.charAt(i);
if (ch >= 'A' && ch <= 'Z') {
ch = (char) (ch + 32);
}
hashCode ^= ch;
hashCode *= PRIME;
}
return hashCode;
}
public static long hashCode64(String key, int offset, int end) {
long hashCode = BASIC;
for (int i = offset; i < end; ++i) {