give some example code on generating id