Hamedan Province's codes are 18, 28. 38 was another reserve code for the province but has be reassigned to Tehran and Alborz Provinces after their last reserve code, 21, was used up. In public cars, Taxis and Governal cars the letter is always the same. But in simple cars this letter (ب) depends on the city.
18
18 is Hamedan county's code and all of the letters are for Hamedan.
References
Vehicle registration plates of Hamedan Wikipedia(Text) CC BY-SA