o yf@s\ddlZddlZddlmZddlZejjZejjZddZd ddZ d dd Z d d Z dS) N)sharedcsht}dt|dtfdddD]}||qWd|S1s+wY|S)Nrbcs SNreadblksizefr_C:\Users\Luke\Documents\Stable diffusion\Automatic1111\stable-diffusion-webui\modules\hashes.py z"calculate_sha256..)hashlibsha256openiterupdate hexdigest)filename hash_sha256chunkrr r calculate_sha256 s   rFcCs~|rtdntd}ztj|}Wn tyYdSw||vr#dS||dd}||dd}||ks;|dur=dS|S)N hashes-addnethashesrmtimer)cacheospathgetmtimeFileNotFoundErrorget)rtitleuse_addnet_hashr ondisk_mtimeZ cached_sha256 cached_mtimerrr sha256_from_caches r'cCs|rtdntd}t|||}|dur|StjjrdStd|ddd|rBt|d }t|}Wdn1s.r) rrseekrint from_bytesrrr)r3rheadernoffsetrrr2r r-Es     r-)F) ros.pathrmodulesrZ modules.cacherr.rr'rr-rrrr s