unisonweb / base

Unison base libraries
https://share.unison-lang.org/@unison/base
18 stars 6 forks source link

hmac and hmacBytes docs seem a bit off #150

Closed ceedubs closed 1 year ago

ceedubs commented 1 year ago

The hmacBytes doc examples use hmac instead of hmacBytes.

Also the hmac doc examples convert the message to Bytes via toUtf8 when they don't necessarily need to, since hmac takes an arbitrary type of message.

runarorama commented 1 year ago

I've updated these docs. I also added the following note:

| ‼️
|
| This function hashes a Unison-specific byte encoding of the message. If you
| want fine control over how the message is encoded, first convert it to Bytes
| and then use hmacBytes instead. See the documentation of hmacBytes for
| details.