我能够通过使用digest()而不是hexdigest()使其工作。然后最后一行变为:
return hash.digest().enpre('base64').strip()然后,结果为24个字符长,并且被Google Cloud Storage传输接受,这需要以base64编码的MD5哈希。

我能够通过使用digest()而不是hexdigest()使其工作。然后最后一行变为:
return hash.digest().enpre('base64').strip()然后,结果为24个字符长,并且被Google Cloud Storage传输接受,这需要以base64编码的MD5哈希。