oculus42 / short-uuid

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

Feature: Consistent Length Short Ids #46

Closed thadeucity closed 3 years ago

thadeucity commented 3 years ago

Implements a padding function when id is shorter than predicted.

Following the Issue #39

A function will calculate how long the Short ID will be with the provided alphabet and pad the result to match the predicted length.

I also implemented a test to check if the feature is working properly.

papb commented 3 years ago

Hello! Nice! Have you considered putting this behavior under an option flag (such as consistentLength) instead of forcing it? I think the package owner prefers an option. (I'd be happy with both approaches)

thadeucity commented 3 years ago

For sure, you are right, it would be better with options. I will try to implement the feature

thadeucity commented 3 years ago

Sent a better one on PullRequest #47