문제

Is there a thread-safe RNG in Bionic? For Linux, I know there is rand_r(), but this is unfortunately not a part of the NDK.

도움이 되었습니까?

해결책

You can simply read from /dev/urandom/ to get pseudo-random bytes. If you need this for cryptographic purposes, you may want to look into OpenSSL as well.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top