<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def generate_id():
 """ Generate a 64bit base 16 ID for use as a Span or Trace ID """

    global _current_pid

    pid = os.getpid()
    if _current_pid != pid:
        _current_pid = pid
        _rnd.seed(int(1000000 * time.time()) ^ pid)
    id = format(_rnd.randint(0, 18446744073709551615), '02x')

    if len(id) < 16:
        id = id.zfill(16)

    return id