improved sql parser. for issue #1979

This commit is contained in:
wenshao
2017-09-17 17:10:55 +08:00
parent ff9364cf12
commit b54a987cc8
5 changed files with 115 additions and 5 deletions
@@ -36,6 +36,25 @@ public final class FnvHash {
return hash;
}
public static long fnv1a_64(String input, int offset, int end) {
if (input == null) {
return 0;
}
if (input.length() < end) {
end = input.length();
}
long hash = BASIC;
for (int i = offset; i < end; ++i) {
char c = input.charAt(i);
hash ^= c;
hash *= PRIME;
}
return hash;
}
public static long fnv1a_64(char[] chars) {
if (chars == null) {
return 0;