Convert Binary Hash to Hex String

The digest header is defined in RFC3230 and SHA-2 support is added in RFC5843. RFC3230 provides an example for MD5 consisting of 16 raw bytes encoded in base64, and an example for SHA-1 consisting of 20 raw bytes encoded in base64. However, RFC5843 provides its example for SHA-256 as 64 hexadecimal ASCII characters encoded in base64, representing 32 bytes. Therefore, a call to hexdigest() depending on a check to see if the result of atob() is a hex string has been added.

Merge request reports

Loading