pub fn encode_key_location(location: Location) -> usize