Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#20 [feat] 6자리 암호 코드 생성 구현 #22

Merged
merged 2 commits into from
Jan 7, 2024
Merged

Conversation

KWY0218
Copy link
Member

@KWY0218 KWY0218 commented Jan 6, 2024

관련 이슈번호

해결하는 데 얼마나 걸렸나요? (예상 작업 시간 / 실제 작업 시간)

  • 30m/30m

해결하려는 문제가 무엇인가요?

  • 6자리 암호 코드 생성 구현

어떻게 해결했나요?

  • 6자리 암호 코드 생성 구현

@KWY0218 KWY0218 self-assigned this Jan 6, 2024
Copy link
Contributor

@pkl0912 pkl0912 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다

Copy link
Member

@hellozo0 hellozo0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

확인했습니다~~! TestCode 작성까지 👍


public class VerificationCodeGenerator {
private static final SecureRandom secureRandom = new SecureRandom();
private static final int START_NUM = 100_000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p5:
사소한 궁금한점이 생겼는데 상수값 사이에 있는 _은 뭘까요..? STARTNUM이 실수 값으로 어디서부터 되는걸까요..?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hellozo0
저희가 돈 계산할 때 1,000 이런 식으로 표현하는데, 자바에서 _ 을 사용해서 000 단위를 분리할 수 있습니다.
100000 -> 10_000
이를 통해 숫자 가독성을 높일 수 있고, 들어가는 값은 똑같이 100000이 들어갑니다.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6자리 숫자를 넘기기 때문에
100,000 ~ 999,999 사이의 값을 반환하고 있습니다.,,!

근데 생각해보니 095843 이런 식으로도 할 수 있는데 너무 단편적으로 생각했네요...!
이 점은 후순위로 수정하겠습니다..!

@KWY0218 KWY0218 merged commit 0d3e3b1 into develop Jan 7, 2024
1 check passed
@KWY0218 KWY0218 deleted the feat/#20 branch January 7, 2024 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] 6자리 랜덤 문자열 생성 util 구현
3 participants