Use function to calculate the id of a routed message.