algoritma rng