2012年10月8日 星期一

[Random Number][Embedded System] How to produce one random number in Embedded System


[Random Number][Embedded System] How to produce one random number in Embedded System



To get a high-quality random number from the linux kernel, use something like this.



hexdump -n4 -e\"%u\" /dev/random



the output of /dev/random is based on activity of keyboard/mouse/network and interrupt statistics and can only generate a few random numbers per second. /dev/urandom can be used as an alternative, which is quicker.

 



Reference :



Related Posts:

0 意見:

張貼留言