Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

9
  • 20
    Better still, use something like 128*md5.block_size instead of 8192. Commented Jan 6, 2011 at 22:51
  • 1
    mrkj: I think it's more important to pick your read block size based on your disk and then to ensure that it's a multiple of md5.block_size. Commented Apr 12, 2013 at 14:10
  • 6
    the b'' syntax was new to me. Explained here. Commented Feb 18, 2014 at 5:19
  • 1
    @ThorSummoner: Not really, but from my working finding optimum block sizes for flash memory, I'd suggest just picking a number like 32k or something easily divisible by 4, 8, or 16k. For example, if your block size is 8k, reading 32k will be 4 reads at the correct block size. If it's 16, then 2. But in each case, we're good because we happen to be reading an integer multiple number of blocks. Commented Mar 16, 2015 at 14:21
  • 1
    "while True" is quite pythonic. Commented Dec 16, 2015 at 9:07