Adding a Booking Reference field

Adding a Booking Reference field

I have a form for booking customer flights. I need to create a booking reference. Can anyone suggest how to. I want the reference to be random but I am willing to accept a solution which is more simple