Is sometimes a case, like this guy, of trial and error.
You might no necessarily need the same length. You will need the right axle length to give you not only a good chainline but also to clear the chainring off the chainstay.
So based on my previous experience it will depend on the chainring size you use (as the bigger the chainring the closer it will run to the chainstay, ie the longer the axle needed to clear) and the frame's wheelbase (the shorter the wheelbase the greater the angle the chainstays leave the bb shell to meet the rear spacing, ie the closer the chainring will run).
Hope it makes sense.