refactor(Base91): 更新Base91解码表并添加示例
更新了Base91解码表的初始化方式,并添加了一个示例方法来演示编码和解码功能。 feat(Base256): 添加Base256编解码器 新增了Base256类,实现了Base256编解码功能,并在BaseUtils中添加了相应的实例。 refactor(BaseCodec): 增加字符串编解码方法 在BaseCodec接口中增加了对字符串进行Base64编码和解码的方法。refactor(OsPath): 简化路径处理逻辑 移除了OsPath类中不必要的方法实现,简化了路径处理逻辑。 feat(UUID): 支持Base256短字符串 在UUID类中添加了对Base256短字符串的支持,包括编码和解码方法。
This commit is contained in:
@@ -16,12 +16,13 @@
|
||||
* ProjectName mingli-utils
|
||||
* ModuleName mingli-utils.main
|
||||
* CurrentFile UUID.kt
|
||||
* LastUpdate 2025-09-17 16:27:32
|
||||
* LastUpdate 2025-09-18 14:39:00
|
||||
* UpdateUser MingLiPro
|
||||
*/
|
||||
|
||||
package com.mingliqiye.utils.uuid
|
||||
|
||||
import com.mingliqiye.utils.base.BASE256
|
||||
import com.mingliqiye.utils.base.BASE64
|
||||
import com.mingliqiye.utils.base.BASE91
|
||||
import com.mingliqiye.utils.random.randomByteSecure
|
||||
@@ -66,6 +67,11 @@ class UUID : Serializable {
|
||||
return UUID(BASE64.decode(baseShortString))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun ofBase256ShortString(baseShortString: String): UUID {
|
||||
return UUID(BASE256.decode(baseShortString))
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun ofBase91ShortString(baseShortString: String): UUID {
|
||||
return UUID(BASE91.decode(baseShortString))
|
||||
@@ -656,6 +662,10 @@ class UUID : Serializable {
|
||||
return BASE91.encode(data)
|
||||
}
|
||||
|
||||
fun getBase256ShortString(): String {
|
||||
return BASE256.encode(data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 提取 UUID V1 中的 MAC 地址。
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user