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

change boundary implementation to hex #523

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

quinlanj
Copy link

The current implementation of the boundary doesn't make sense because we are generating a number between 0-9 and converting it to a string with a radix of 16.

If we want the boundary to be base 10, we should have:
boundary += Math.floor(Math.random() * 10).toString(10);

If we want the boundary to be base 16, we should have:
boundary += Math.floor(Math.random() * 16).toString(16);

I'd recommend base 16 because it has more entropy and still conforms with the rfc spec

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

Successfully merging this pull request may close these issues.

None yet

1 participant