What is a good method for generating random b-bit, S-smooth numbers?

For S large and b not too large, it may be feasible to generate random numbers and test if they are smooth enough. If S is too small, the S-smooth numbers are too sparse; if b is too large, deciding if a number is S-smooth is too difficult.

When the above is infeasible (say, b = 10 000, S = $10^{100}$) it seems that generating smooth numbers requires understanding their properties. Consider generating random semiprimes near n: take s = 1/2 + 1/3 + 1/5 + ... + $1/\sqrt n$, then choose a prime $p\le\sqrt n$ with probability $s/p$ and finally choose a random prime $q$ near $n/p$, yielding $pq$ as the semiprime.

Is there a similar procedure for smooth numbers?

## Alternate, non-algorithmic approach

A random integer* has about $\log k$ prime factors between $m$ and $m^k$ (in a Poisson sense). What can be said about the distribution of prime factors of an S-smooth integer instead, with $m^k < S$? (Presumably, unlike in the first case, $b$ matters.)

Similarly, for small primes p, what is the distribution of the p-adic valuation of random S-smooth b-bit numbers?

`*`

"Random integer" is, of course, meaningless. But in this context I'm looking mod a fixed set of primes, and in that context it's well-defined. (In Pari terminology, random `intmod`

s are OK.)