Add random mode.

Signed-off-by: cyberzhg <cyberzhg@gmail.com>