-
大小: 25KB文件類型: .zip金幣: 1下載: 0 次發(fā)布日期: 2021-01-06
- 語言: Java
- 標(biāo)簽: java??hash??digestAlgori??
資源簡介
提供了獲取哈希值接口、獲取哈希算法標(biāo)識已經(jīng)使用算法值接口源碼,接口都是正式封裝的,IDEA編譯,輸出結(jié)果符合官方數(shù)據(jù)
代碼片段和文件信息
/*??shaw?2018-12-17
*???獲取哈希值
*??算法標(biāo)識(32771代表md5RSA,32772代表sha1RSA,32772代表SM2)
*??個人主頁:https://user.qzone.qq.com/1939484341/infocenter
*/
package?psic;
import?server.Hash;
import?sun.misc.base64Encoder;
public?class?SHAWApp?{
????//獲取哈希值
????public?String?ShawHashData(int?hashAlgo?byte[]?i_inData)?throws?Exception?{
????????String?inData?=?new?String(i_inData);
????????String?hashStr?=?““;
????????server.Hash?hash?=?new?Hash();
????????if(hashAlgo==32771)?{
????????????hashStr?=?hash.md5(inData);
????????}
????????else?if(hashAlgo==32772)?{
????????????hashStr?=?hash.sha1(inData);
????????}
????????else?{
????????????System.out.println(“hashAlgo?is?32771?or?32772!?please?input?again!“);
????????????return?null;
????????}
????????byte[]?byteA?=?hash.hexStringToBytes(hashStr);
????????BA
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-12-18?14:16??getHash-demo\
?????目錄???????????0??2018-12-18?14:16??getHash-demo\.idea\
?????文件?????????449??2018-12-18?13:51??getHash-demo\.idea\compiler.xm
?????目錄???????????0??2018-12-18?14:16??getHash-demo\.idea\copyright\
?????文件??????????74??2018-12-18?13:51??getHash-demo\.idea\copyright\profiles_settings.xm
?????文件?????????340??2018-12-18?13:51??getHash-demo\.idea\deployment.xm
?????文件?????????192??2018-12-18?14:12??getHash-demo\.idea\encodings.xm
?????目錄???????????0??2018-12-18?14:16??getHash-demo\.idea\inspectionProfiles\
?????文件?????????173??2018-12-18?13:51??getHash-demo\.idea\inspectionProfiles\Project_Default.xm
?????文件?????????273??2018-12-18?13:51??getHash-demo\.idea\misc.xm
?????文件?????????248??2018-12-18?13:51??getHash-demo\.idea\modules.xm
?????文件???????25286??2018-12-18?14:16??getHash-demo\.idea\workspace.xm
?????目錄???????????0??2018-12-18?14:16??getHash-demo\out\
?????目錄???????????0??2018-12-18?14:16??getHash-demo\out\production\
?????目錄???????????0??2018-12-18?14:16??getHash-demo\out\production\test\
?????目錄???????????0??2018-12-18?14:16??getHash-demo\out\production\test\psic\
?????文件????????3261??2018-12-18?14:15??getHash-demo\out\production\test\psic\SHAWApp.class
?????目錄???????????0??2018-12-18?14:16??getHash-demo\out\production\test\server\
?????文件????????2091??2018-12-18?14:15??getHash-demo\out\production\test\server\Hash.class
?????文件???????14161??2018-12-18?14:15??getHash-demo\out\production\test\server\Util.class
?????目錄???????????0??2018-12-18?14:16??getHash-demo\src\
?????目錄???????????0??2018-12-18?14:16??getHash-demo\src\psic\
?????文件????????4199??2018-12-18?14:15??getHash-demo\src\psic\SHAWApp.java
?????目錄???????????0??2018-12-18?14:16??getHash-demo\src\server\
?????文件????????1757??2018-12-17?11:19??getHash-demo\src\server\Hash.java
?????文件???????17478??2018-12-17?14:11??getHash-demo\src\server\Util.java
?????文件?????????532??2018-12-18?13:51??getHash-demo\test.iml
評論
共有 條評論