rust-crypto
rust-crypto copied to clipboard
Add result_str, and possibly input_str to Mac
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.
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!
What's the status of this project? Should I close this?
The maintainer seems to have abandoned it. I guess we're all waiting for a new hero to step forth..