Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to clean a string to make it into a valid id #163

Open
ftomassetti opened this issue Sep 27, 2024 · 2 comments
Open

Add function to clean a string to make it into a valid id #163

ftomassetti opened this issue Sep 27, 2024 · 2 comments

Comments

@ftomassetti
Copy link
Contributor

LionWeb has strong limits on the characters that can be used in an id or a key. This means that someone generating IDs from various sources can end up producing illegal IDs. Just removing all the forbidden characters can lead to conflicts. So this problem could be solved in this library, to avoid different users having to solve it individually.

@enikao
Copy link
Contributor

enikao commented Oct 1, 2024

We should also add these two methods to the library, that encode/decode an arbitrary string to a valid LW id:

new String(Base64.getUrlDecoder().decode(lionWebId), StandardCharsets.UTF_8);
Base64.getUrlEncoder().withoutPadding().encodeToString(mpsId.toString().getBytes(StandardCharsets.UTF_8));

@ftomassetti
Copy link
Contributor Author

Yes, they would be very useful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants