code: def fast_md5_file(path, block_size=256 * 128, stream=False):
      if stream:
          return hashlib.md5(
              ("###MAGNITUDEURI:" + path).encode("utf-8")
          ).hexdigest()
      else:
          md5 = hashlib.md5()
          f_size = os.path.getsize(path)
          if f_size <= 104857600:
              return md5_file(path, block_size)
          clipped_f_size = f_size - (block_size + 1)
          md5.update(str(f_size).encode("utf-8"))
          interval = 25
          seek_interval = int(float(clipped_f_size) / float(interval))
          with open(path, "rb") as f:
              for i in range(interval):
                  f.seek((i * seek_interval) % clipped_f_size)
                  chunk = f.read(block_size)
                  md5.update(chunk)
          return md5.hexdigest()
  
file_path: magnitude/pymagnitude/converter_shared.py
imports: import hashlib
  import numpy
  import os
  from itertools import islice, chain
label_desc: Use image node_id 2 for calling a global function with example usage: fast_md5_file(path, block_size, stream) and returns: hashlib, md5, md5_file