我一直在努力缠绕一些东西 -
我正在尝试了解有关API的更多信息,
以计算消化,您必须执行以下操作:
“ sha-512 =” + base64(sha512(有效载荷)
对于一个空字符串,输出应为“ SHA-512 = Z4PHNX7VUL3XVCHQ1M2AB9YG5AULVXCGG/SPIDNS6C5H0NE8XYXYXYXYSP+dgnKHFUWVY7KXVUDBEOGOGLODJ6+SFAPG
==
我需要在计算中添加一些东西吗?
RFC 3230- http中的实例摘要
...
HTTP中的实例摘要(RFC 3230)
在文档中,我已经解释了此示例,我们有:
raw_payload = "{\"data\":{\"type\":\"customerAccessToken\",\"attributes\":{\"applicationCustomerReference\":\"15874569\"}}}"
digest = "SHA-512=" + BASE64(SHA512(raw_payload)
=> "SHA-512=z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg=="
我需要在计算中添加一些东西,而不是仅仅是空字符串?
当我尝试按照示例进行示例时,结果是完全不同的 - 这是一个空白的计算。
任何帮助都将不胜感激:轻微的_smile:
i've been struggling to wrap my head around something - https://datatracker.ietf.org/doc/html/rfc3230#section-4.3.2
I'm trying to learn more about the API in general
To calculate the digest, you must do the following:
"SHA-512=" + Base64(SHA512(payload)
For an empty string, the output should be "SHA-512=z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg=="
I tried to do this for the empty payload but never came to the same conclusion..
Do I need to add something into the computation?
RFC 3230 - Instance Digests in HTTP
...
Instance Digests in HTTP (RFC 3230)
In the documentation I have explaining this example, we have this:
raw_payload = "{\"data\":{\"type\":\"customerAccessToken\",\"attributes\":{\"applicationCustomerReference\":\"15874569\"}}}"
digest = "SHA-512=" + BASE64(SHA512(raw_payload)
=> "SHA-512=z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg=="
Do I need to add something to the calculation instead of the just the empty string?
When I try to follow the example, the result is completely different - this is a calculation with an empty body.
Any help would be greatly appreciated :slight_smile:
发布评论