  We show that if $n$ is odd and $p \ge C \log n / n$, then with high
probability Hamilton cycles in $G(n,p)$ span its cycle space. More generally,
we show this holds for a class of graphs satisfying certain natural
pseudorandom properties. The proof is based on a novel idea of
parity-switchers, which can be thought of as analogues of absorbers in the
context of cycle spaces. As another application of our method, we show that
Hamilton cycles in a near-Dirac graph $G$, that is, a graph $G$ with odd $n$
vertices and minimum degree $n/2 + C$ for sufficiently large constant $C$, span
its cycle space.
