randombyte1 [JS] 이메일 인증 코드 생성하기 이메일 인증이나 별도의 인증코드를 만들어 보내줘야 할 때 그냥 번호만 띡 하고 만들어서 보내면 뭔가 보안상 안 좋을 것 같기도 하고 제일 큰 문제는 멋있지가 않다... 그래서 이번에는 랜덤으로 코드를 생성해주는 crypto.randomBytes를 사용해 보았다. crypto.randomBytes( size, callback ) 사용방법과 설명은 GeeksforGeeks에서 자세히 잘 나와있다. // Node.js program to demonstrate the // crypto.randomBytes() method // Including crypto module const crypto = require('crypto'); // Calling randomBytes method with callback cr.. 2022. 2. 13. 이전 1 다음