7 sp cassette is (Shimano HG) 31.9mm wide
8 sp cassette is (Shimano) 35.4mm wide
9 sp cassette is (Shimano) 36.5mm wide
I don't know how the wide, say Hopes, 7 speed spacer is though.
So say 3.5 to 4.5mm ?
EDIT to add,
7 sp freehub body spline length (Shimano hyperglide-C) = 28.4mm
8 sp freehub body spline length (Shimano hyperglide-C) = 32.9mm
(both splines finish 1.7mm from the end of the body, so are comparable for this)
So 4.5mm I guess is needed.
EDIT to add, the ID is 34.5mm, OD for an in cassette spacer is normally 42mm, well at least for the 3mm wide Alu 8 speed ones
The plastic washer are always a touch ticker than t