import { getNonCryptoRandomValues } from "../../../shared/src/random-values.js";
function nanoid(size = 21) {
  const randomBytes = getNonCryptoRandomValues(new Uint8Array(size));
  return randomBytes.reduce((id, byte) => {
    byte &= 63;
    if (byte < 36) {
      id += byte.toString(36);
    } else if (byte < 62) {
      id += (byte - 26).toString(36).toUpperCase();
    } else if (byte > 62) {
      id += "-";
    } else {
      id += "_";
    }
    return id;
  }, "");
}
export {
  nanoid
};
//# sourceMappingURL=nanoid.js.map
