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

René Kijewski notifications at github.com
Sun Aug 25 19:58:59 CEST 2013


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

`hash += 32*hash + buf[i];`, optimizing the multiplication is should be done by the compiler, not in the code.

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


More information about the notifications mailing list