mplanchard/cuid-rust

cuid::is_cuid panics on empty strings

DeppLearning opened this issue · 2 comments

Thanks for the crate. Using it for a while now but encountered this issue today.

Instead of a panic I was expecting the method to return false. If this isn't feasible then maybe document the behavior?

Example:

cuid::is_cuid("")

-> panicked at 'byte index 1 is out of bounds of'

Resolved with a4fca2f and released in version 1.1.0, along with some improvements to the is_cuid() and is_slug() functions. Thanks again for the report!