PKI.genpass | R Documentation |
PKI.genpass
generates n
cryptographically strong
pseudo-random password by using a given set of allowed characters.
PKI.genpass(n=15, set=c(alphanum, ".", "/"), block=5, sep="-")
n |
positive integer, number of random elements in the password |
set |
character vector, set of characters to use in the
password, ideally its length should be a power of 2 and must be at
most 256. Internal variable |
block |
non-negative integer, number of character blocks in the password or 0 if no separated blocks are desired. |
sep |
string, separator between blocks (only used if 0 <
|
PKI.genpass
generates a password based on a set of allowable
characters by subsetting the set with bytes generated using
PKI.random
.
If block
is >0 and <n
then blocks of block
characters are separated by the separator string sep
. This is
typically used to guarantee at least one special character in the
password. The default results in a 90-bit random password of the form
XXXXX-XXXXX-XXXXX
.
String, generated password.
This is just a utility front-end to PKI.random(n)
to
subset set
modulo its length. If the set does not have a length
which is a power of 2 then a warning is issued and the leading
elements are more likely to be used, reducing the password strength.
Simon Urbanek
PKI.genpass()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.