knitr::opts_chunk$set(
  tidy = "styler",
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
pkgload::load_all()

nanoidr

GitHub last commit

ai/nanoid is a tiny, secure, URL-friendly, unique string ID generator for JavaScript. The nanoidr package is an R port of NanoID.

The original NanoID library generates random strings using crypto API, which is replaced with openssl::rand_bytes in nanoidr package. See also Generating Secure Random Numbers in R for more details about openssl::rand_bytes.

Installation

remotes::install_github("paithiov909/nanoidr")

Usage

## Basic usage.
nanoidr::nanoid()
## You can use your own random number generator.
nanoidr::nanoid(29, func = function(size) {
  runif(size, 0, 255)
})

Alternatives

License

MIT license.

Icon made by Those Icons from www.flaticon.com.



paithiov909/nanoidr documentation built on Jan. 26, 2025, 9:54 p.m.