Density-functional theory calculations of hopping rates of surface diffusion