rust-crypto icon indicating copy to clipboard operation
rust-crypto copied to clipboard

Add result_str, and possibly input_str to Mac

Open mhart opened this issue 11 years ago • 3 comments

Digest has a handy result_str function, but for Mac (eg Hmac), to just get a hex string, you need to use serialize::hex::ToHex and do the following:

hmac.result().code().as_slice().to_hex()

This seems very verbose and it would be nice to have a cleaner way to achieve this.

mhart avatar Oct 20 '14 02:10 mhart

Good point. On the one hand, it seem a little odd that Digest offers what feels like a pretty specialized function. On the other hand, hex encoding results is so common that maybe that makes sense. And it doesn't really make much sense that Digest has it but Mac doesn't. I'll work on a patch in the next few days to add something like that in. Thanks!

DaGenix avatar Nov 20 '14 05:11 DaGenix

What's the status of this project? Should I close this?

mhart avatar Sep 13 '15 17:09 mhart

The maintainer seems to have abandoned it. I guess we're all waiting for a new hero to step forth..

marcusklaas avatar Sep 13 '15 20:09 marcusklaas