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

chore: Better randomness #6755

Merged
merged 4 commits into from
Apr 2, 2024
Merged

chore: Better randomness #6755

merged 4 commits into from
Apr 2, 2024

Conversation

gastonfournier
Copy link
Contributor

@gastonfournier gastonfournier commented Apr 2, 2024

About the changes

This change is irrelevant as it doesn't pose a security risk, but there's no reason for us not to use a different type of random generation for the sessionId

Note: the magic number 18 was picked because that's the length of the string we get from String(Math.random())

Closes https://github.com/Unleash/unleash/security/code-scanning/68 and https://github.com/Unleash/unleash/security/code-scanning/69

Copy link

vercel bot commented Apr 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 2, 2024 0:36am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Apr 2, 2024 0:36am

Copy link
Member

@sighphyre sighphyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, seems okay to me

@sighphyre
Copy link
Member

Note: the magic number 18 was picked because that's the length of the string we get from String(Math.random())

Math.random() produces a float so that's true... sometimes xD

@gastonfournier gastonfournier merged commit e845459 into main Apr 2, 2024
13 checks passed
@gastonfournier gastonfournier deleted the better-randomness branch April 2, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants