Safer circuit id generation