randomUid function

Int64 randomUid(
  1. Random prng
)

Returns a uniformly pseudorandom UID u such that -263 <= u < 0 or 2 < u < 263

Implementation

Int64 randomUid(math.Random prng) {
  var answer = Int64.ZERO;
  while (answer == Int64.ZERO || answer == inboxUid || answer == rootFolderUid) {
    answer = Int64.fromInts(_next32bitInt(prng), _next32bitInt(prng));
  }
  return answer;
}