code: def _trim_base64(s):
      
      if len(s) > 64 and _base64.match(s.replace('\n', '')):
          h = hash_string(s)
          s = '%s...<snip base64, md5=%s...>' % (s[:8], h[:16])
      return s
docs: Trim and hash base64 strings