You need to fit one bearing docc then use a pair of vernier calipers and measure from the fitted bearing inner race face to the seat of the opposite side. A spacer equal to or few thou or even more longer than this measurement is ok but shorter is a no,no as it will pre load the bearing too much when you torque up the axle. I found my spacer too short and glued some shims onto it (only to hold them in place when the axle was removed).
You are aiming for a spacer that is the exact dimension between the bearing inner faces when both bearings are seated up against the bearing bores outer race shoulders. A fractionally longer spacer is acceptable but any dimension shorter is not.
This is the #1 reason for short wheel bearing life along with using high pressure washers foolishly.
Ciao