Efficient algorithms for stochastic decoding of LDPC codes