random_password: Generate a random password with a specified length

Description Usage Arguments Value Author(s) See Also Examples

View source: R/random_password.R

Description

This function generates a random passord sampled from the ASCII table.

Usage

1
random_password(length = 12, replace = FALSE, extended = TRUE)

Arguments

length

length of the password

replace

sample from the ASCII table with (TRUE) or without (FALSE) replacement?

extended

if FALSE, use alphanumeric characters only; otherwise use all the ASCII characters

Value

a character string

Author(s)

Yihui Xie <https://yihui.org>

See Also

sample

Examples

1
2
3
4
5
6
7
random_password()
# set the seed to get fixed password every time; you may just remember the seed
# and forget the real password because it's reproducible
set.seed(123)
random_password()
# long password
random_password(20, TRUE)

Example output

[1] "&7I]g\\t@RmPK"
[1] ";jFqu$OnxG{|"
[1] "`V)u7#?zta\\~^cSX;-{u"

fun documentation built on Oct. 24, 2020, 1:07 a.m.