https://github.com/paithiov909/nanoidr
A pure R port of NanoID
https://github.com/paithiov909/nanoidr
nanoid r r-package
Last synced: 5 days ago
JSON representation
A pure R port of NanoID
- Host: GitHub
- URL: https://github.com/paithiov909/nanoidr
- Owner: paithiov909
- License: other
- Created: 2019-12-04T07:48:06.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2025-01-26T08:59:02.000Z (9 months ago)
- Last Synced: 2025-04-19T09:58:56.231Z (6 months ago)
- Topics: nanoid, r, r-package
- Language: R
- Homepage: https://paithiov909.github.io/nanoidr/
- Size: 2.22 MB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
tidy = "styler",
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
pkgload::load_all()
```[](#)
[ai/nanoid](https://github.com/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](https://cran.r-project.org/web/packages/openssl/vignettes/secure_rng.html) for more details about `openssl::rand_bytes`.## Installation
``` r
remotes::install_github("paithiov909/nanoidr")
```## Usage
```{r usage}
## Basic usage.
nanoidr::nanoid()
## You can use your own random number generator.
nanoidr::nanoid(29, func = function(size) {
runif(size, 0, 255)
})
```## Alternatives
- [hrbrmstr/nanoid: Tools to Generate Short, Secure, URL-friendly, and Unique String Identifiers](https://github.com/hrbrmstr/nanoid)
- [reside-ic/ids: :information_source: Simple random identifiers](https://github.com/reside-ic/ids)
- [sqids/sqids-r: Official R port of Sqids. Generate short unique IDs from numbers.](https://github.com/sqids/sqids-r)
- [stri_rand_strings: Generate Random Strings - R Package stringi](https://stringi.gagolewski.com/rapi/stri_rand_strings.html)
- [random_strings: random_strings in stringfish: Alt String Implementation](https://rdrr.io/cran/stringfish/man/random_strings.html)## License
MIT license.
Icon made by [Those Icons](https://www.flaticon.com/authors/those-icons) from [www.flaticon.com](https://www.flaticon.com/).