oculus42 / short-uuid

Translate standard UUIDs into shorter formats and back.
MIT License
450 stars 13 forks source link

Feature: Options Parameter #47

Closed thadeucity closed 3 years ago

thadeucity commented 3 years ago

Following Issue #39

Inserted the option to select consistent dimension for short-ids

Also inserted an option to remove repeated characters in alphabets

Way better than my last Pull Request, now you can choose to have Consistent Length or not, leaving the original flow unchanged.

If you find anything wrong, please let me know.

oculus42 commented 3 years ago

I'm not sure about the prevent repeat behavior. Unlike the padding, it creates a condition where two instances may translate something differently. I would be more inclined to have the library throw an error if you try to use an alphabet with repeating characters without setting an explicit repeat flag rather than have it silently change the alphabet.

oculus42 commented 3 years ago

Because it's irrevocably ES6, I'm going to go ahead and convert the rest before publishing a 4.0.0 version, but am working on it right now.