title: Python hashlib and sparse files
body: <p>I wanted to know how does python hashlib library treat sparse files. If the file has a lot of zero blocks then instead of wasting CPU and memory on reading zero blocks does it do any optimization like scanning the inode block map and reading only allocated blocks to compute the hash?</p>
  
  <p>If it does not do it already, what would be the best way to do it myself.</p>
  
  <p>PS: Not sure it would be appropriate to post this question in StackOverflow Meta.</p>
  
  <p>Thanks.</p>