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

Base64 may not be URL safe #26

Open
Rohitrajak1807 opened this issue Jul 3, 2021 · 0 comments
Open

Base64 may not be URL safe #26

Rohitrajak1807 opened this issue Jul 3, 2021 · 0 comments

Comments

@Rohitrajak1807
Copy link

const hash = crypto.createHash("sha256").update(url).digest("base64")

@hnasr base64 encoding used in the URL shortener may have a '/' un the URL_ID, so using digest('base64url') is advised to avoid this.

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

1 participant