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

randomInt returns a negative number #7

Open
dispalt opened this issue Sep 17, 2019 · 1 comment
Open

randomInt returns a negative number #7

dispalt opened this issue Sep 17, 2019 · 1 comment

Comments

@dispalt
Copy link

dispalt commented Sep 17, 2019

Looking at the go code, the random int they generate is positive only. Which makes sense. So I think changing the code to something like would be better.

    def randomInt: Int = {
      val maxInt = 0xff << 16 | 0xff << 8 | 0xff
      Random.nextInt(maxInt)
    }
@kolotaev
Copy link
Owner

Yeh, hey use positive signed int in xid. I'll consider your suggestion and include it in ride. Thank you!

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