| 634 | #define SIG_FNV_PRIME 1099511628211ULL |
| 635 | |
| 636 | static uint64_t sig_fold(uint64_t h, const void *data, size_t len) { |
| 637 | const unsigned char *p = data; |
| 638 | for (size_t i = 0; i < len; i++) { |
| 639 | h ^= p[i]; |
| 640 | h *= SIG_FNV_PRIME; |
| 641 | } |
| 642 | return h; |
| 643 | } |
| 644 | |
| 645 | /* Fold a listed path's (size, mtime) into the signature so an in-place edit |
| 646 | * of an already-dirty file still produces a new signature. A failed stat |
no outgoing calls
no test coverage detected