def md5_digest(instr):
 if six.PY3:
  b = salt.utils.to_bytes(instr)
  return hashlib.md5(b).hexdigest()
 return hashlib.md5(instr).hexdigest()

def md5_digest ( instr ) : if six . PY3 : b = salt . utils . to_bytes ( instr ) return hashlib . md5 ( b ) . hexdigest ( ) return hashlib . md5 ( instr ) . hexdigest ( )
generate an md5 hash of a given string .