Create Password Generator App with R

Live Online Training : Data Science with R

- Explain Advanced Algorithms in Simple English
- Live Projects
- Case Studies
- Job Placement Assistance
- Get 10% off till Sept 25, 2017
- Batch starts from October 8, 2017

This tutorial explains how to create password generator utility with R.

R Function - Password Generator

Features -
  1. Each password contains numeric, special character, lowercase letter and uppercase letter.
  2. Flexibility to define the length of a password
  3. Flexibility to specify the number of passwords you want to generate
password.generator <- function(len, n){
  dummydt=data.frame(matrix(ncol=0,nrow=n))
  num <- 1:9
  spcl <- c("!",  "#", "$", "%", "&", "(", ")", "*",  "+", "-", "/", ":",
             ";", "<", "=", ">", "?", "@", "[", "^", "_", "{", "|", "}", "~")
  comb <- c(num, spcl, letters, LETTERS)
  p <- c(rep(0.035, 9), rep(0.015, 25), rep(0.025, 52))
  password<-replicate(nrow(dummydt),paste0(sample(comb, len, TRUE, prob = p), collapse = ""))
  dummydt$password<-password
  return(dummydt)
}
PasswrdFile = password.generator(len = 8, n = 100)

Parameters - 
  1. len - Length of a password
  2. n - number of passwords you want to generate

R Tutorials : 75 Free R Tutorials

About Author:

Deepanshu founded ListenData with a simple objective - Make analytics easy to understand and follow. He has close to 7 years of experience in data science and predictive modeling. During his tenure, he has worked with global clients in various domains like retail and commercial banking, Telecom, HR and Automotive.


While I love having friends who agree, I only learn from those who don't.

Let's Get Connected: Email | LinkedIn

Get Free Email Updates :
*Please confirm your email address by clicking on the link sent to your Email*

Related Posts:

0 Response to "Create Password Generator App with R"

Post a Comment

Next → ← Prev