摘要:
出自:http://www.blogjava.net/conans/articles/331384.html方便自己查阅。publicclassHashAlgorithms{/***加法hash**@paramkey*字符串*@paramprime*一个质数*@returnhash结果*/publicstaticintadditiveHash(Stringkey,intprime){inthash,i;for(hash=key.length(),i=0;i<key.length();i++)hash+=key.charAt(i);return(hash%prime);}/***旋转has 阅读全文