github.com/fufuok/balancer@v1.0.0/utils/runtime.go (about)

     1  package utils
     2  
     3  import (
     4  	_ "unsafe"
     5  )
     6  
     7  // FastRandn similar to fastrand() % n, but faster.
     8  // See https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
     9  //go:linkname FastRandn runtime.fastrandn
    10  func FastRandn(n uint32) uint32