Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/liying2008/digestutil
A digest utils library written in Kotlin (For Java and Android) .
https://github.com/liying2008/digestutil
aes android-library android-tools base64 crc32 des digest gradle hex java kotlin library md2 md5 sha1 sha256
Last synced: 25 days ago
JSON representation
A digest utils library written in Kotlin (For Java and Android) .
- Host: GitHub
- URL: https://github.com/liying2008/digestutil
- Owner: liying2008
- License: mit
- Created: 2017-11-10T13:34:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-11-23T11:12:20.000Z (about 3 years ago)
- Last Synced: 2024-11-15T09:49:55.101Z (about 1 month ago)
- Topics: aes, android-library, android-tools, base64, crc32, des, digest, gradle, hex, java, kotlin, library, md2, md5, sha1, sha256
- Language: Java
- Homepage:
- Size: 99.6 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# DigestUtil
[![Download](https://api.bintray.com/packages/liying2008/DigestUtil/DigestUtil/images/download.svg)](https://bintray.com/liying2008/DigestUtil/DigestUtil/_latestVersion)
[![Maven Central](https://img.shields.io/maven-central/v/cc.duduhuo.util/digest-util.svg)](https://mvnrepository.com/artifact/cc.duduhuo.util/digest-util)
[![license](https://img.shields.io/github/license/liying2008/DigestUtil.svg)](https://github.com/liying2008/DigestUtil/blob/master/LICENSE)
[![简书](https://img.shields.io/badge/简书-独毒火-brightgreen.svg)](http://www.jianshu.com/u/14ab91761183)A digest utils library written in Kotlin (For Java and Android) .
## 1. Download
### Use Gradle
```gradle
implementation 'cc.duduhuo.util:digest-util:1.1.1'
```### Or Maven
```xml
cc.duduhuo.util
digest-util
1.1.1```
## 2. Use
Call the static method in `Digest` / `Base64` / `AES` / `DES` .
**In Kotlin**
```kotlin
println("============== Base64 ==============")
println("base64 = " + Base64.encode("abc"))println("============== Digest ==============")
println("md2 = " + Digest.md2Hex("abc", true))
println("md5 = " + Digest.md5Hex("abc", true))
println("sha1 = " + Digest.sha1Hex("abc", true))
println("sha224 = " + Digest.sha224Hex("abc", true))
println("sha256 = " + Digest.sha256Hex("abc", true))
println("sha384 = " + Digest.sha384Hex("abc", true))
println("sha512 = " + Digest.sha512Hex("abc", true))
// File digest
println("sha256 = " + Digest.sha256Hex(File("build.gradle.kts"), true))println("============== CRC32 ==============")
println("crc32 = " + CRC32.getValue("abc"))
println("crc32 = " + CRC32.getValue(File("build.gradle.kts")))
```**In Java**
```java
System.out.println("============== Base64 ==============");
System.out.println("base64 = " + Base64.encode("abc"));System.out.println("============== Digest ==============");
System.out.println("md2 = " + Digest.md2Hex("abc", true));
System.out.println("md5 = " + Digest.md5Hex("abc", true));
System.out.println("sha1 = " + Digest.sha1Hex("abc", true));
System.out.println("sha224 = " + Digest.sha224Hex("abc", true));
System.out.println("sha256 = " + Digest.sha256Hex("abc", true));
System.out.println("sha384 = " + Digest.sha384Hex("abc", true));
System.out.println("sha512 = " + Digest.sha512Hex("abc", true));
// File digest
System.out.println("sha256 = " + Digest.sha256Hex(new File("build.gradle.kts"), true));System.out.println("============== CRC32 ==============");
System.out.println("crc32 = " + CRC32.getValue("abc"));
System.out.println("crc32 = " + CRC32.getValue(new File("build.gradle.kts")));
```## 3. ChangeLog
Updated date: 2019-04-13
[CHANGELOG](CHANGELOG.md)
## 4. Author
Email: [[email protected]](mailto:[email protected])
## 5. License
[MIT](LICENSE)