A class of tests for the two-sample problem whose test statistic is an L2 norm of the difference of the empirical characteristic functions of the samples is considered. The null distribution can be estimated by means of bootstrap or permutation procedures. Although very easy to implement, such procedures can become computationally expensive as the sample size or the dimension of the data increase. This paper proposes to approximate the null distribution through a weighted bootstrap. The method is studied both theoretically and numerically. It provides a consistent estimator of the null distribution. The asymptotic properties are similar to those of the bootstrap and permutation estimators but, from a computational point of view, the weighted bootstrap estimator is more efficient. The proposed approach is also applied to the two-sample location problem and to the k-sample problem.