Consolidated generation of friend ids