[racket] string->bytes/locale on an HMAC-SHA1 hash returns error

From: Shawn Smith (shawn.p.smith at gmail.com)
Date: Sun May 13 22:18:53 EDT 2012

Hi,

I'm trying to generate a SHA1 hash using a private key and a given string,
like so:

(define a-hash (HMAC-SHA1 (string->bytes/locale "foo")
(string->bytes/locale "bar")))

This returns bytes, but when I try to turn those bytes into a string with:

(bytes->string/locale a-hash)

I get:

bytes->string/locale: string is not a well-formed UTF-8 encoding:
#"F\264\354Xa\27\25M\254\324\235fN]c\375\310\216\373Q"

As I have no clue how to diagnose this, I'd appreciate any suggestions or
help.

Thanks,
Shawn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120513/e50e8247/attachment.html>

Posted on the users mailing list.