lukechampine / blake3

An AVX-512 accelerated implementation of the BLAKE3 cryptographic hash function
MIT License
352 stars 25 forks source link

could we remove the panic? #16

Closed marcosrmendezthd closed 1 year ago

marcosrmendezthd commented 1 year ago

could just return an error

https://github.com/lukechampine/blake3/blob/7afca5966e5e77e5e595d4aba20fa619fe1070e8/blake3.go#L283

lukechampine commented 1 year ago

The docstring of io.Seeker does not specify how an invalid whence should be handled, so implementations naturally differ. Some return an error; others panic; others do nothing (usually leaving offset = 0). Personally, I consider this to be a developer error, making it non-recoverable, and therefore panicking seems appropriate.

marcosrmendezthd commented 1 year ago

understood