ride icon indicating copy to clipboard operation
ride copied to clipboard

randomInt returns a negative number

Open dispalt opened this issue 6 years ago • 1 comments

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)
    }

dispalt avatar Sep 17 '19 02:09 dispalt

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

kolotaev avatar Sep 17 '19 08:09 kolotaev