def generate_api_key():
    # 256bit seed from urandom
    seed = os.urandom(256)
    # since urandom does not provide sufficient entropy hash, base64encode and salt.
    # The resulting value is now large and should be hard to predict.
    hashed_seed = hashlib.sha256(seed).hexdigest()
    return base64.b64encode(
        hashed_seed,
        random.choice(['rA', 'aZ', 'gQ', 'hH', 'hG', 'aR', 'DD'])).rstrip('==')
:return: A list of style names valid for the service.
dataset/ETHPy150Open StackStorm/st2/st2common/st2common/util/auth.py/generate_api_key--crossover with--dataset/ETHPy150Open hydroshare/hydroshare2/ga_ows/views/wms/base.py/WMSAdapterBase.styles