Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
update UserMailSendService.java
Browse files Browse the repository at this point in the history
난수 생성에 seed 추가
  • Loading branch information
ori0o0p committed Apr 3, 2024
1 parent 3fd5ec8 commit 07fe824
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,15 @@ private String getMailTemplate(String key) {

private String getRandomCode() {
SecureRandom secureRandom = new SecureRandom();
byte[] seed = new byte[32];
secureRandom.nextBytes(seed);
secureRandom.setSeed(seed);
byte[] randomBytes = new byte[4];
secureRandom.nextBytes(randomBytes);
return Base64.getUrlEncoder().withoutPadding().encodeToString(randomBytes);

return Base64.getUrlEncoder()
.withoutPadding()
.encodeToString(randomBytes);
}

}

0 comments on commit 07fe824

Please sign in to comment.