connor4312 / blake3

BLAKE3 hashing for JavaScript: native Node bindings (where available) and WebAssembly
https://connor4312.github.io/blake3/index.html
MIT License
177 stars 19 forks source link

Possibly incorrect wording in `hash` documentation? #18

Closed darthdeus closed 4 years ago

darthdeus commented 4 years ago

The API docs for the hash(data, options) function say:

By default, it creates a hash with the first 32 bytes of data, but this is configurable.

This seems strange. Since BLAKE3 is an extendable output function it seems that it should instead say

By default, it creates a 32 byte long hash of the data, but this is configurable.

at least that's what the function probably should be doing, right? Unless I'm missing something, we want to compute the hash based on the whole data content, but the size of the hash might be variable (which is why it being XOF is good).

connor4312 commented 4 years ago

Thanks for the issue!