()
return base_str
Pass a long link and it returns the next available
    base62 short code.
    :return: str
Pass a long link and it returns the next available
    base62 short code.
    :return: str
Pass a long link and it returns the next available base62 short code . : return : str
def next_short_code():
    """Pass a long link and it returns the next available
    base62 short code.
    :return: str
    """
    link_manager = LinkManager()
    link = link_manager.latest_default_link()
    # First link
    if link is None:
        base_id = 1
        base_str = HashDigest().shorten(base_id)
    else:
        base_id = HashDigest().decode(link.short_code) + 1
        base_str = HashDigest().shorten(base_id)
        while link_manager.find(short_code=base_str):
            base_id += 1
            base_str = HashDigest().shorten(base_id)
    return base_str
def next_short_code ( ) : link_manager = LinkManager ( ) link = link_manager . latest_default_link ( ) # First link if link is None : base_id = 1 base_str = HashDigest ( ) . shorten ( base_id ) else : base_id = HashDigest ( ) . decode ( link . short_code ) + 1 base_str = HashDigest ( ) . shorten ( base_id ) while link_manager . find ( short_code = base_str ) : base_id += 1 base_str = HashDigest ( ) . shorten ( base_id ) return base_str