{"id":21832740,"url":"https://github.com/liying2008/digestutil","last_synced_at":"2025-04-14T07:37:26.716Z","repository":{"id":57715464,"uuid":"110250569","full_name":"liying2008/DigestUtil","owner":"liying2008","description":"A digest utils library written in Kotlin (For Java and Android) .","archived":false,"fork":false,"pushed_at":"2021-11-23T11:12:20.000Z","size":102,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T21:11:48.984Z","etag":null,"topics":["aes","android-library","android-tools","base64","crc32","des","digest","gradle","hex","java","kotlin","library","md2","md5","sha1","sha256"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liying2008.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-10T13:34:48.000Z","updated_at":"2024-09-14T01:30:15.000Z","dependencies_parsed_at":"2022-09-03T08:13:27.707Z","dependency_job_id":null,"html_url":"https://github.com/liying2008/DigestUtil","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liying2008%2FDigestUtil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liying2008%2FDigestUtil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liying2008%2FDigestUtil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liying2008%2FDigestUtil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liying2008","download_url":"https://codeload.github.com/liying2008/DigestUtil/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248840535,"owners_count":21170006,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aes","android-library","android-tools","base64","crc32","des","digest","gradle","hex","java","kotlin","library","md2","md5","sha1","sha256"],"created_at":"2024-11-27T19:25:14.307Z","updated_at":"2025-04-14T07:37:26.685Z","avatar_url":"https://github.com/liying2008.png","language":"Java","readme":"# DigestUtil\n\n[![Download](https://api.bintray.com/packages/liying2008/DigestUtil/DigestUtil/images/download.svg)](https://bintray.com/liying2008/DigestUtil/DigestUtil/_latestVersion)\n[![Maven Central](https://img.shields.io/maven-central/v/cc.duduhuo.util/digest-util.svg)](https://mvnrepository.com/artifact/cc.duduhuo.util/digest-util)\n[![license](https://img.shields.io/github/license/liying2008/DigestUtil.svg)](https://github.com/liying2008/DigestUtil/blob/master/LICENSE)\n[![简书](https://img.shields.io/badge/简书-独毒火-brightgreen.svg)](http://www.jianshu.com/u/14ab91761183)\n\nA digest utils library written in Kotlin (For Java and Android) .\n\n## 1. Download\n\n### Use Gradle  \n\n```gradle  \nimplementation 'cc.duduhuo.util:digest-util:1.1.1'\n```\n\n### Or Maven  \n\n```xml  \n\u003cdependency\u003e\n  \u003cgroupId\u003ecc.duduhuo.util\u003c/groupId\u003e\n  \u003cartifactId\u003edigest-util\u003c/artifactId\u003e\n  \u003cversion\u003e1.1.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## 2. Use\n\nCall the static method in `Digest` / `Base64` / `AES` / `DES` .\n\n**In Kotlin**\n\n```kotlin\nprintln(\"============== Base64 ==============\")\nprintln(\"base64 = \" + Base64.encode(\"abc\"))\n\nprintln(\"============== Digest ==============\")\nprintln(\"md2 = \" + Digest.md2Hex(\"abc\", true))\nprintln(\"md5 = \" + Digest.md5Hex(\"abc\", true))\nprintln(\"sha1 = \" + Digest.sha1Hex(\"abc\", true))\nprintln(\"sha224 = \" + Digest.sha224Hex(\"abc\", true))\nprintln(\"sha256 = \" + Digest.sha256Hex(\"abc\", true))\nprintln(\"sha384 = \" + Digest.sha384Hex(\"abc\", true))\nprintln(\"sha512 = \" + Digest.sha512Hex(\"abc\", true))\n// File digest\nprintln(\"sha256 = \" + Digest.sha256Hex(File(\"build.gradle.kts\"), true))\n\nprintln(\"============== CRC32 ==============\")\nprintln(\"crc32 = \" + CRC32.getValue(\"abc\"))\nprintln(\"crc32 = \" + CRC32.getValue(File(\"build.gradle.kts\")))\n```\n\n**In Java**\n\n```java\nSystem.out.println(\"============== Base64 ==============\");\nSystem.out.println(\"base64 = \" + Base64.encode(\"abc\"));\n\nSystem.out.println(\"============== Digest ==============\");\nSystem.out.println(\"md2 = \" + Digest.md2Hex(\"abc\", true));\nSystem.out.println(\"md5 = \" + Digest.md5Hex(\"abc\", true));\nSystem.out.println(\"sha1 = \" + Digest.sha1Hex(\"abc\", true));\nSystem.out.println(\"sha224 = \" + Digest.sha224Hex(\"abc\", true));\nSystem.out.println(\"sha256 = \" + Digest.sha256Hex(\"abc\", true));\nSystem.out.println(\"sha384 = \" + Digest.sha384Hex(\"abc\", true));\nSystem.out.println(\"sha512 = \" + Digest.sha512Hex(\"abc\", true));\n// File digest\nSystem.out.println(\"sha256 = \" + Digest.sha256Hex(new File(\"build.gradle.kts\"), true));\n\nSystem.out.println(\"============== CRC32 ==============\");\nSystem.out.println(\"crc32 = \" + CRC32.getValue(\"abc\"));\nSystem.out.println(\"crc32 = \" + CRC32.getValue(new File(\"build.gradle.kts\")));\n```\n\n## 3. ChangeLog\n\nUpdated date: 2019-04-13\n\n[CHANGELOG](CHANGELOG.md)\n\n## 4. Author\n\nEmail: [liruoer2008@yeah.net](mailto:liruoer2008@yeah.net)\n\n## 5. License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliying2008%2Fdigestutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliying2008%2Fdigestutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliying2008%2Fdigestutil/lists"}