code: def rehash(path, blocksize=1 << 20):
      """Return (hash, length) for path using hashlib.sha256()"""
      h = hashlib.sha256()
      length = 0
      with open(path, "rb") as f:
          while block := f.read(blocksize):
              length += len(block)
              h.update(block)
      digest = "sha256=" + urlsafe_b64encode(h.digest()).decode(
          "latin1"
      ).rstrip("=")
      # unicode/str python2 issues
      return (digest, str(length))
  
imports: import glob
  import hashlib
  import os
  import os.path
  import platform
  import shutil
  import subprocess
  import sys
  import zipfile
  from base64 import urlsafe_b64encode
label_desc: Use image node_id 1 for calling a global function with example usage: rehash(path, blocksize) and returns: digest,  str