# est-spi-tools **Repository Path**: est-spi/tools ## Basic Information - **Project Name**: est-spi-tools - **Description**: No description available - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-15 - **Last Updated**: 2026-03-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # EST SPI Tools [English Version](README.en.md) ## EST SPI 工具集模块 est-spi-tools 是 EST SPI 框架的工具集模块,提供了 IO、日期、数学、哈希和编码等常用工具类。 ### 核心工具类 #### IOUtils - IO工具 提供流操作、字节数组转换等功能。 #### DateUtils - 日期工具 提供日期计算、格式化、解析等功能。 #### MathUtils - 数学工具 提供基本数学运算、三角函数、统计等功能。 #### HashUtils - 哈希工具 提供 MD5、SHA-1、SHA-256、SHA-512 等哈希算法。 #### EncodeUtils - 编码工具 提供 Base64、URL、HTML 等编码解码功能。 ### 快速开始 使用 IOUtils: ```java import ltd.idcu.est.spi.tools.IOUtils; import java.io.ByteArrayInputStream; import java.io.InputStream; public class Example { public static void main(String[] args) throws Exception { String text = "Hello, World!"; InputStream input = IOUtils.toInputStream(text); String result = IOUtils.toString(input); System.out.println(result); } } ``` 使用 DateUtils: ```java import ltd.idcu.est.spi.tools.DateUtils; import java.util.Date; public class Example { public static void main(String[] args) { Date now = DateUtils.now(); Date tomorrow = DateUtils.addDays(now, 1); String formatted = DateUtils.format(tomorrow); System.out.println("Tomorrow: " + formatted); } } ``` 使用 MathUtils: ```java import ltd.idcu.est.spi.tools.MathUtils; public class Example { public static void main(String[] args) { int sum = MathUtils.sum(1, 2, 3, 4, 5); double avg = MathUtils.average(1, 2, 3, 4, 5); System.out.println("Sum: " + sum); System.out.println("Average: " + avg); } } ``` 使用 HashUtils: ```java import ltd.idcu.est.spi.tools.HashUtils; public class Example { public static void main(String[] args) { String text = "Hello, World!"; String md5 = HashUtils.md5(text); String sha256 = HashUtils.sha256(text); System.out.println("MD5: " + md5); System.out.println("SHA-256: " + sha256); } } ``` 使用 EncodeUtils: ```java import ltd.idcu.est.spi.tools.EncodeUtils; public class Example { public static void main(String[] args) { String text = "Hello, World!"; String base64 = EncodeUtils.base64Encode(text); String decoded = EncodeUtils.base64Decode(base64); System.out.println("Base64: " + base64); System.out.println("Decoded: " + decoded); } } ``` ### Maven 依赖 ```xml ltd.idcu.est.spi est-spi-tools 1.0.0 ``` ### 许可证 MIT License