-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add patch request to library service
- Loading branch information
1 parent
43a0ed6
commit c910878
Showing
7 changed files
with
46 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
library-api-users-service/src/main/java/dev/earlspilner/users/service/KeyGen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package dev.earlspilner.users.service; | ||
|
||
import java.math.BigInteger; | ||
import java.security.SecureRandom; | ||
|
||
/** | ||
* @author Alexander Dudkin | ||
*/ | ||
public class KeyGen { | ||
|
||
private static final SecureRandom secureRandom = new SecureRandom(); | ||
private static final int BIT_LENGTH = 256; | ||
private static final int RADIX = 16; | ||
|
||
public static String generateKey() { | ||
BigInteger key = new BigInteger(BIT_LENGTH, secureRandom); | ||
return key.toString(RADIX); | ||
} | ||
|
||
public static void main(String[] args) { | ||
System.out.println(generateKey()); | ||
} | ||
|
||
} |