Calculate user ID