MCPcopy Create free account
hub / github.com/SNAS/openbmp / hash_toStr

Method hash_toStr

Server/src/MsgBusInterface.hpp:618–629  ·  view source on GitHub ↗

* \brief binary hash to printed string format * * \details Converts a hash unsigned char bytes to HEX string for * printing or storing in the DB. * * \param[in] hash_bin 16 byte binary/unsigned value * \param[out] hash_str Reference to storage of string value * */

Source from the content-addressed store, hash-verified

616 *
617 */
618 static void hash_toStr(const u_char *hash_bin, std::string &hash_str){
619
620 int i;
621 char s[33];
622
623 for (i=0; i<16; i++)
624 sprintf(s+i*2, "%02x", hash_bin[i]);
625
626 s[32]='\0';
627
628 hash_str = s;
629 }
630
631 /**
632 * \brief Time in seconds to printed string format

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected