본문 바로가기
개발

자바스크립트에서 난수 생성(Math.random vs crypto.getRandomValues)

by 홍냥냥냥냥 2023. 9. 21.
728x90
728x90

- Math.random()메서드는 암호화적으로 안전하지 않은 무작위 알고리즘을 사용한다.


- crypto.getRandomValues() 메서드는 암호화된 강력한 무작위 값을 반환. 매개변수는 typeArray이다.

 

 

 

 

https://www.w3schools.com/jsref/met_crypto_getrandomvalues.asp

 

JavaScript crypto API getRandomValues() Method

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

 

 

728x90
300x250

댓글