import string
import random


def get_uid(length=12):
    """
    Generate and return a random string which can be considered unique.
    Default length is 12 characters from set [a-zA-Z0-9].
    """
    alphanum = string.ascii_uppercase + string.digits
    return ''.join([alphanum[random.randint(0, len(alphanum) - 1)]
                    for _ in range(length)])