import string
import random


def generate_id(length):
    """Generate ID of specified length."""
    letters = string.digits + "abcdef"
    return ''.join(random.choice(letters) for i in range(length))