Is there a standard way of representing an SHA1 hash as a C string, and how do I convert to it?

This question is about how to create an SHA-1 hash from an array of data in C using the OpenSSL library.

It returns an array of 20 bytes, containing the hash. Is there some standard way of representing that data in string form, not binary?

If so, is there a function in OpenSSL itself to convert to said string format?

If not, how should it be done? Of course, I can dream up my own encoding, use base64 or what not, but is there some canonical format?

6
задан Community 23 May 2017 в 12:16
поделиться