message: [crypto] add human readable format for hash
  This will be useful when storing hashes in human readable format (i.e.,
  secure storage using base64).
  Closes:
  Approved by: JoshLind
diff: @@ -269,32 +269,26 @@ impl ser::Serialize for HashValue {
  where
  S: ser::Serializer,
  {
  + if serializer.is_human_readable() {
  + serializer.serialize_str(&self.to_hex())
  + } else {
  serializer.serialize_bytes(&self.hash[..])
  }
  }
  +}
  impl<'de> de::Deserialize<'de> for HashValue {
  fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
  where
  D: de::Deserializer<'de>,
  {
  - struct HashValueVisitor;
  - impl<'de> de::Visitor<'de> for HashValueVisitor {
  - type Value = HashValue;
  -
  - fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
  - formatter.write_str("HashValue in bytes")
  - }
  -
  - fn visit_bytes<E>(self, value: &[u8]) -> std::result::Result<HashValue, E>
  - where
  - E: de::Error,
  - {
  - HashValue::from_slice(value).map_err(E::custom)
  - }
  + if deserializer.is_human_readable() {
  + let encoded_hash: &str = ::serde::Deserialize::deserialize(deserializer)?;
  + HashValue::from_hex(encoded_hash).map_err(<D::Error as ::serde::de::Error>::custom)
  + } else {
  + let b = <&[u8]>::deserialize(deserializer)?;
  + Self::from_slice(b).map_err(<D::Error as ::serde::de::Error>::custom)
  }
  -
  - deserializer.deserialize_bytes(HashValueVisitor)
  }
  }
  