X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Flookup_table.h;h=91684c4319ab3fcaaacfc945e9cca2916ac44516;hp=5620e678e865c2f3859e35bf60821273eb543f05;hb=53d4db68e30bf45b983c59f91e5e2a3e039e1426;hpb=dcfbcf5cce40b473afb8303245c035f37d72ac9b diff --git a/src/lookup_table.h b/src/lookup_table.h index 5620e678..91684c43 100644 --- a/src/lookup_table.h +++ b/src/lookup_table.h @@ -35,8 +35,17 @@ struct lookup_table_entry { /* Number of times this lookup table entry is referenced by dentries. */ u32 refcnt; - /* SHA1 hash of the file resource pointed to by this lookup table entry */ - u8 hash[WIM_HASH_SIZE]; + union { + /* SHA1 hash of the file resource pointed to by this lookup + * table entry */ + u8 hash[WIM_HASH_SIZE]; + + /* First 4 or 8 bytes of the SHA1 hash, used for inserting the + * entry into the hash table. Since the SHA1 hashes can be + * considered random, we don't really need the full 20 byte hash + * just to insert the entry in a hash table. */ + size_t hash_short; + }; /* If @file_on_disk != NULL, the file resource indicated by this lookup * table entry is not in the WIM file, but rather a file on disk; this