A new finite-size scaling approach to random walks