Hi @jedisct1! What is the idea of randombytes_uniform returning 0 when upper_limit < 2, instead of causing some sort of error? Was a bit surprised, so do you want a PR for documentation? Relevant lineshttps://github.com/jedisct1/libsodium/blob/master/src/libsodium/randombytes/randombytes.c#L136-L138 …
Why raise an error? You can use it to pick a random element in an array no matter what the array size is, even if the array has a single element. No special case to handle here.