- function getGTK(str){
- var hash = 5381;
- for(var i = 0, len = str.length; i < len; ++i)
- {
- hash += (hash << 5) + str.charAt(i).charCodeAt();
- }
- return hash & 0x7fffffff;
- }
- //该片段来自于http://www.codesnippet.cn/detail/160120148548.html
来源: http://www.codesnippet.cn/detail/160120148548.html