各位大神,java的hashcode函式原始碼如下,想用Oracle_plsql實作,這個function該怎么寫。
Java_hashcode原理:s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
public int hashCode() {
int h = hash;
int len = count;
if (h == 0 && len > 0) {
int off = offset;
char val[] = value;
for (int i = 0; i < len; i++) {
h = 31*h + val[off++];
}
hash = h;
}
return h;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/235732.html
標籤:開發
下一篇:像面試題只有一個表,怎么進行查詢
