traits icon indicating copy to clipboard operation
traits copied to clipboard

password-hash: add `Error::OutputSize`

Open daxpedda opened this issue 2 years ago • 2 comments

See https://github.com/RustCrypto/password-hashes/pull/313.

Sometimes a very specific output size is expected. Any bike-shedding is very welcome.

daxpedda avatar Jun 16 '22 21:06 daxpedda

This is back to having three different variants that effectively mean different flavors of the same thing.

What about this instead?

OutputSize { expected: Ordering, size: usize }

tarcieri avatar Jul 24 '22 14:07 tarcieri

OutputSize { expected: Ordering, size: usize }

I wasn't sure how you mean that, I kinda turned it around, the usize holds the expected size and the Ordering holds if the actual size is too long, too short, or unequal (doesn't match properly I guess).

Also squashed the commits.

EDIT: I hope the documentation is sufficient and alright.

daxpedda avatar Jul 24 '22 14:07 daxpedda

@tarcieri just saw the new update to 0.5.0-pre.0, are we ready to add this breaking change now?

daxpedda avatar Jan 09 '23 08:01 daxpedda

Thanks!

tarcieri avatar Jan 09 '23 16:01 tarcieri