Metadata-Version: 1.1
Name: ShortStr
Version: 1.0.0
Summary: ShortStr is a Python module to generate unambiguous, homoglyph-less "shortstrings" for URL shortners and similar services.
Home-page: https://github.com/asweigart/shortstr
Author: Al Sweigart
Author-email: al@inventwithpython.com
License: BSD
Description: ========
        shortstr
        ========
        
        ShortStr is a Python module to generate unambiguous, homoglyph-less "shortstrings" for URL shortners and similar services.
        
        `pip install shortstr`
        
        Websites such as Pastebin have unique alphanumeric strings IDs, like https://pastebin.com/mKxTdEeT. Code like `''.join([random.choice(string.ascii_letters + string.digits) for x in range(5)])` can be used to generate strings like `'DY6iv'`, but these can include similar-looking characters (called homoglyphs) like O and 0.
        
        The shortstr module generates these shortstrings without the l, I, o, O, 0, and 1 homoglyphs. It also has checksum and can check for repeat shortstrings to ensure you only produce unique shortstrings, and uses `os.urandom()` to produce truly random shortstrings, not pseudorandom shortstrings.
        
        Examples
        ========
        
            >>> import shortstr
            >>> shortstr.generate()
            'kZXmL9'
            >>> shortstr.generate('ddddd')
            '67249f'
            >>> shortstr.generate('ddddd', includeChecksum=False)
            '39844'
            >>> shortstr.generate('ccccc', includeChecksum=False)
            'gKXda'
            >>> shortstr.generate('lllll', includeChecksum=False)
            'qibkp'
            >>> shortstr.generate('uuuuu', includeChecksum=False)
            'WWXGC'
            >>> shortstr.generate('***dddcccllluuu', includeChecksum=False)
            '5SP534FiBtxtMCG'
            >>> shortstr.isValid('kZXmL9')
            True
            >>> shortstr.isValid('67249f')
            True
            >>> shortstr.isValid('invalid shortstring')
            False
Keywords: url shortener shorten checksum random string id identifier unique
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Win32 (MS Windows)
Classifier: Environment :: X11 Applications
Classifier: Environment :: MacOS X
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.1
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
