Young87

SmartCat's Blog

So happy to code my life!

游戏开发交流QQ群号60398951

当前位置:首页 >跨站数据测试

murmurhash2和djb

两个hash算法


1、djb算法

    /* the famous DJB Hash Function for strings */  
    unsigned int DJBHash(char *str)  
    {  
        unsigned int hash = 5381;  
       
        while (*str){  
            hash = ((hash << 5) + hash) + (*str++); /* times 33 */  
        }  
        hash &= ~(1 << 31); /* strip the highest bit */  
        return hash;  
    }  
以上代码取自http://blog.csdn.net/chaosinux

除特别声明,本站所有文章均为原创,如需转载请以超级链接形式注明出处:SmartCat's Blog

上一篇: TI Cortex-A8 AM335X开发板工控板

下一篇: 将shell脚本用到实处

精华推荐