import secrets
import click


def generate_secret_key(num_bytes, show=True):
    """Generate and print a random string of SIZE bytes."""
    rnd = secrets.token_urlsafe(num_bytes)
    if show:
        click.secho(rnd)
    return rnd