Generate id for objects