[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


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:

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

-------------- 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.