[riot-notifications] [RIOT] Bloom bytes (#176)

René Kijewski notifications at github.com
Mon Aug 26 02:13:52 CEST 2013


> +{
> +    uint32_t hash = 5381;
> +
> +    for (int i = 0; i < len; i++) {
> +        hash = hash * 33 + buf[i];
> +    }
> +
> +    return hash;
> +}
> +
> +uint32_t sdbm_hash(const uint32_t *buf, int len)
> +{
> +    uint32_t hash = 0;
> +
> +    for (int i = 0; i < len; i++) {
> +        hash = buf[i] + (hash << 6) + (hash << 16) - hash;

`hash = hash * 65599 + buf[i];`

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/176/files#r5970082
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20130825/7f6d97d7/attachment.html>


More information about the notifications mailing list