Learn R Programming

rcdf (version 0.1.2)

generate_pw: Generate a random password

Description

This function generates a random password of a specified length. It includes alphanumeric characters by default and can optionally include special characters.

Usage

generate_pw(length = 16, special_chr = TRUE)

Value

A character string representing the generated password.

Arguments

length

Integer. The length of the password to generate. Default is 16.

special_chr

Logical. Whether to include special characters (e.g., `!`, `@`, `#`, etc.) in the password. Default is TRUE.

Examples

Run this code
generate_pw()
generate_pw(32)
generate_pw(12, special_chr = FALSE)

Run the code above in your browser using DataLab