3 Commits

Author SHA1 Message Date
97809cd321 Merge pull request 'v0.0.8' (#7) from dev into master
Reviewed-on: #7
2026-06-05 03:59:55 +00:00
Timi
801a945991 v0.0.8
All checks were successful
CI/CD / build-deploy (pull_request) Successful in 12s
2026-06-05 11:59:41 +08:00
Timi
112e6290f0 add random text pool 2026-06-05 11:59:35 +08:00
2 changed files with 11 additions and 3 deletions

View File

@@ -6,7 +6,7 @@
<groupId>com.imyeyu.utils</groupId> <groupId>com.imyeyu.utils</groupId>
<artifactId>timi-utils</artifactId> <artifactId>timi-utils</artifactId>
<version>0.0.7</version> <version>0.0.8</version>
<properties> <properties>
<maven.test.skip>true</maven.test.skip> <maven.test.skip>true</maven.test.skip>

View File

@@ -15,8 +15,16 @@ import java.util.UUID;
*/ */
public class Text { public class Text {
public static String LETTER_POOL = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
public static String NUMBER_POOL = "0123456789";
public static String LETTER_NUMBER_POOL = LETTER_POOL + LETTER_POOL;
public static String PASSWORD_CHAR_POOL = LETTER_NUMBER_POOL + "!#$%&()*+,-./:;<=>?@[]^_`{|}~";
/** 十六进制小写 */ /** 十六进制小写 */
public static char[] HEX_DIGITS_LOWER = "0123456789abcdef".toCharArray(); public static char[] HEX_DIGITS_LOWER = (NUMBER_POOL + "abcdef").toCharArray();
/** /**
* 是否为半角字符 * 是否为半角字符
@@ -150,7 +158,7 @@ public class Text {
} }
public static String randomString(int length) { public static String randomString(int length) {
return randomString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", length); return randomString(LETTER_NUMBER_POOL, length);
} }
public static String randomString(String pool, int length) { public static String randomString(String pool, int length) {