摘要: 出自: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 阅读全文
posted @ 2012-09-24 16:05 doo 阅读(2014) 评论(0) 推荐(1) 编辑