Detlef Riekenberg wrote in <trinity-3bcb06b1-9b2f-4bf0-8310-be13f02cdb7e-1688080498166@3c-app-webde\ -bs37>: ... |I do not think, that we really need a 64bit hash (with 64bit multiply) |for the complete file content. | |In addition to the filename and the filesize, i suggest to use "st_mtime": | much cheaper and available for free.
How is it with file time resolution over there? In general i see nanosecond stuff flying by. I wouldn't really mind .. but other than that i still make heavy use of Chris Torek's hash (as used by Berkeley DB), even though i now mix the result as shown by Bret Mulvey. for(; (c = *buf++) != '\0';)\ xh = (xh << 5) + xh + (unsigned char)c;\ /* Since mixing matters mostly for pow2 spaced maps, mixing the \ * lower 32-bit seems to be sufficient (? in practice) */\ if(xh != 0){\ xh += xh << 13;\ xh ^= xh >> 7;\ xh += xh << 3;\ xh ^= xh >> 17;\ xh += xh << 5;\ }\ Anyway faster than xxhash or siphash or something. Even CRC-32? --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel