On 11/12/20 9:26 AM, [email protected] wrote:
> +static inline u32 hash128to32(char *bytes)
> +{
> +     u32 *tmp = (u32 *)bytes;
> +     u32 res;
> +
> +     res = ntohl(tmp[0] ^ tmp[1] ^ tmp[2] ^ tmp[3]);
> +     if (likely(res))
> +             return res;
> +     res = tmp[0] | tmp[1] | tmp[2] | tmp[3];
> +     return !res ? 0 : ntohl(18140715);

In case that the hashed result is accidentally equal to the fix
number(ie, ntohl(18140715)), how would we be able to differentiate it
with the case where the hashed result is 0?

> +}


_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to