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

René Kijewski notifications at github.com
Sun Aug 25 20:01:11 CEST 2013


>  
> -    while ((c = (unsigned char) * str++)) {
> -        hash = c + (hash << 6) + (hash << 16) - hash;
> +    for(int i = 0; i < len; i++) {
> +        hash = buf[i] + (hash << 6) + (hash << 16) - hash;

Thats reaaaly ugly. :) Use `hash = 65599*hash + buf[i];`.

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


More information about the notifications mailing list