Skip to content

TheSongList/rand-string

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rand-string

Generates a "random" string of a specified length.

Usage

Currently there are 5 types:

  • uppercase
  • lowercase
  • upperlower
  • alphanumerical
  • ascii

You can probably guess what each one would create

The function requires 2 parameters type and length; Type of course is the above.

import rand_string.rand_string as rand
rand.RandString(type, length)

Now lets look at some examples

uppercase:

print(rand.RandString("uppercase", 10))
# Output: TPDROEAVRY

lowercase:

print(rand.RandString("lowercase", 10))
# Output: mdvsewzkwf

upperlower:

print(rand.RandString("upperlower", 10))
# Output: YjHFGzysFx

alphanumerical:

print(rand.RandString("alphanumerical", 10))
# Output: Fy0Nbqno6B

ascii:

print(rand.RandString("ascii", 10))
# Output: jtj-NV<PSV

About

Generates a random string of a specified length.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages