From 52e72221bf65d118bc323866243f3fdbd2589c58 Mon Sep 17 00:00:00 2001 From: Cody Logan Date: Wed, 5 Aug 2020 17:21:45 -0700 Subject: Initialize gh-pages --- _modules/alphanum/alphanum.html | 229 ++++++++++++++++++++++++++++++++++++++++ _modules/index.html | 197 ++++++++++++++++++++++++++++++++++ 2 files changed, 426 insertions(+) create mode 100644 _modules/alphanum/alphanum.html create mode 100644 _modules/index.html (limited to '_modules') diff --git a/_modules/alphanum/alphanum.html b/_modules/alphanum/alphanum.html new file mode 100644 index 0000000..2da5dd2 --- /dev/null +++ b/_modules/alphanum/alphanum.html @@ -0,0 +1,229 @@ + + + + + + + + + + alphanum.alphanum — alphanum 0.2.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
    + +
  • »
  • + +
  • Module code »
  • + +
  • alphanum.alphanum
  • + + +
  • + +
  • + +
+ + +
+
+
+
+ +

Source code for alphanum.alphanum

+try:
+    import secrets as random
+except ImportError:
+    import random
+import string
+
+POP = string.ascii_letters + string.digits
+
+
+
[docs]def generate(length: int = 1) -> str: + """Generates a random string of alphanumeric characters of the given length. + If no length is specified, a single character is returned. + + On Python 3.5, this string is pseudo-randomly generated using + :py:mod:`random`. With 3.6 and later, the randomness is generated with + :py:mod:`secrets`, making the randomization cryptographically strong. + + Args: + length (:obj:`int`, optional): Desired string length. Defaults to 1. + + Returns: + str: A pseudo-random alphanumeric string. + + Examples: + >>> print(alphanum.generate()) + 'G' + >>> print(alphanum.generate(10)) + 'a93jfDjdA0' + + """ + return ''.join(random.SystemRandom().choice(POP) for i in range(length))
+
+ +
+ +
+
+ + +
+ +
+

+ + © Copyright 2020, Cody Logan + +

+
+ + + + Built with Sphinx using a + + theme + + provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + \ No newline at end of file diff --git a/_modules/index.html b/_modules/index.html new file mode 100644 index 0000000..498660c --- /dev/null +++ b/_modules/index.html @@ -0,0 +1,197 @@ + + + + + + + + + + Overview: module code — alphanum 0.2.0 documentation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
    + +
  • »
  • + +
  • Overview: module code
  • + + +
  • + +
  • + +
+ + +
+
+
+
+ +

All modules for which code is available

+ + +
+ +
+
+ + +
+ +
+

+ + © Copyright 2020, Cody Logan + +

+
+ + + + Built with Sphinx using a + + theme + + provided by Read the Docs. + +
+ +
+
+ +
+ +
+ + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3