https://github.com/hinsteny/commons
Java12 Collect some more useful utils!
https://github.com/hinsteny/commons
base64 dsa ecdsa java12 md5 rsa
Last synced: 3 months ago
JSON representation
Java12 Collect some more useful utils!
- Host: GitHub
- URL: https://github.com/hinsteny/commons
- Owner: Hinsteny
- Created: 2019-06-04T09:00:15.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-29T17:25:07.000Z (over 3 years ago)
- Last Synced: 2025-07-27T15:55:44.536Z (5 months ago)
- Topics: base64, dsa, ecdsa, java12, md5, rsa
- Language: Java
- Homepage:
- Size: 325 KB
- Stars: 3
- Watchers: 1
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## commons (Java 基础工具集合包)
-------------------
[](https://www.codacy.com/app/Hinsteny/commons?utm_source=github.com&utm_medium=referral&utm_content=Hinsteny/commons&utm_campaign=Badge_Grade)
[](https://travis-ci.org/Hinsteny/commons)
[](https://codecov.io/gh/Hinsteny/commons)
[](https://maven-badges.herokuapp.com/maven-central/com.github.hinsteny/commons-core)
## Java环境
open-jdk12
## 模块划分
* commons-parent: 父模块, 进行项目说明及相关依赖声明
* commons-core: 核心模块, 定义最基础的Java相关操作工具集合
* commons-warp: 对一些常用的Java生态中的工具进行封装集成, 比如okhhtp, httpclient, javax.mail, poi等
## 开发与发布
1. 发布到sonatype, 供大家引入使用
```
mvn clean deploy -Dmaven.skip.test=true -X
```
2. 项目中配置使用jacoco做代码覆盖率检测, 执行命令为
```
mvn clean test
```
## 功能描述
* 常用签名及加解密工具类: Base64, MD5, DES, 3DES, DSA, ECDSA, RSA, SHARS;
* 常见算法工具类实现: 二叉堆(堆排序)
## 引入使用
1. 在项目pom.xml文件中加入依赖
```
com.github.hinsteny
commons-core
0.0.3
```
2. 在项目的module-info.java文件中添加模块依赖
```
requires com.github.hinsteny.commons.core;
```
3. 使用模块中的工具类
```
String myMessage = "Hello Hinsteny. nice to see you!";
KeyPair keyPair = RSASignUtil.generateKeyPair();
String publicKey = RSASignUtil.getPublicKey(keyPair);
String privateKey = RSASignUtil.getPrivateKey(keyPair);
System.out.println("============== 默认RSA签名前后使用Base64加解码 ==============");
String sign = signWithRsa(myMessage, privateKey, DEFAULT_CHARSET);
System.out.println(String.format("sign data: %s, result: %s", myMessage, sign));
boolean verify = verifyWithRsa(myMessage, sign, publicKey, DEFAULT_CHARSET);
System.out.println("verify result: " + verify);
```
## License
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2019-present, Hinsteny