Fastrange: A fast alternative to the modulo reduction
github.com
github.com
this is so well known in fact that arm gcc defaults to this when a proper constant exists if you do division or modulus operator...
The "fastrange" is a very different operation on prime factors than modulo.