{"id":16122047,"url":"https://github.com/foxcapades/lib-jvm-md5","last_synced_at":"2025-04-06T11:41:07.990Z","repository":{"id":61358330,"uuid":"550908670","full_name":"Foxcapades/lib-jvm-md5","owner":"Foxcapades","description":"Convenience wrapper for generating MD5 hashes.","archived":false,"fork":false,"pushed_at":"2022-11-16T20:38:00.000Z","size":282,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-12T17:19:20.113Z","etag":null,"topics":["checksum","hash","library","md5"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/Foxcapades.png","metadata":{"files":{"readme":"readme.adoc","changelog":null,"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":"2022-10-13T14:20:15.000Z","updated_at":"2022-10-13T15:54:05.000Z","dependencies_parsed_at":"2022-10-15T20:51:16.482Z","dependency_job_id":null,"html_url":"https://github.com/Foxcapades/lib-jvm-md5","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/Foxcapades%2Flib-jvm-md5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Flib-jvm-md5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Flib-jvm-md5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Foxcapades%2Flib-jvm-md5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Foxcapades","download_url":"https://codeload.github.com/Foxcapades/lib-jvm-md5/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478234,"owners_count":20945262,"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":["checksum","hash","library","md5"],"created_at":"2024-10-09T21:09:13.212Z","updated_at":"2025-04-06T11:41:07.951Z","avatar_url":"https://github.com/Foxcapades.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"= MD5\n:source-highlighter: pygments\n:lib-version: 1.0.1\n\nimage:https://img.shields.io/github/license/foxcapades/lib-jvm-md5[GitHub]\nimage:https://img.shields.io/badge/docs-dokka-green[link=\"https://foxcapades.github.io/lib-jvm-md5/\"]\nimage:https://img.shields.io/maven-central/v/io.foxcapades.lib/md5[Maven Central, link=\"https://search.maven.org/artifact/io.foxcapades.lib/md5\"]\n\nConvenience wrapper around using the JDK `MessageDigest` type to generate MD5\nchecksums.\n\n\n== Import\n\n.build.gradle.kts\n[source, kotlin, subs=\"verbatim,attributes\"]\n----\n  implementation(\"io.foxcapades.lib:md5:{lib-version}\")\n----\n\n.build.gradle\n[source, groovy, subs=\"verbatim,attributes\"]\n----\n  implementation \"io.foxcapades.lib:md5:{lib-version}\"\n----\n\n.pom.xml\n[source, xml, subs=\"verbatim,attributes\"]\n----\n    \u003cdependency\u003e\n      \u003cgroupId\u003eio.foxcapades.lib\u003c/groupId\u003e\n      \u003cartifactId\u003emd5\u003c/artifactId\u003e\n      \u003cversion\u003e{lib-version}\u003c/version\u003e\n    \u003c/dependency\u003e\n----\n\n\n== Examples\n\n.Kotlin\n[source, kotlin]\n----\nimport io.foxcapades.lib.md5.MD5\nimport java.io.File\n\nfun main() {\n  // Hashing the contents of a file\n  val fileHash = MD5.hash(File(\"readme.adoc\"))\n\n  // Hashing a plain string\n  val stringHash = MD5.hash(\"some text\")\n\n  // Hashing a reader stream\n  val readerHash = MD5.hash(\"some text\".reader())\n\n  // Hashing an InputStream\n  val streamHash = MD5.hash(\"some text\".byteInputStream())\n\n  // Printing a hash as a lowercase hex string\n  println(fileHash.toHexString(true))\n\n  // Printing a hash as an uppercase hex string\n  println(stringHash.toHexString())\n\n  // Getting the raw bytes of a hash\n  readerHash.bytes\n}\n----\n\n.Java\n[source, java]\n----\nimport io.foxcapades.lib.md5.MD5;\nimport io.foxcapades.lib.md5.MD5Hash;\n\nimport java.io.ByteArrayInputStream;\nimport java.io.File;\nimport java.io.StringReader;\n\npublic class Example {\n\n  public static void main(String[] args) {\n    // Hashing the contents of a file\n    MD5Hash fileHash = MD5.hash(new File(\"readme.adoc\"));\n\n    // Hashing a plain string\n    MD5Hash stringHash = MD5.hash(\"some text\");\n\n    // Hashing a reader stream\n    MD5Hash readerHash = MD5.hash(new StringReader(\"some text\"));\n\n    // Hashing an InputStream\n    MD5Hash streamHash = MD5.hash(new ByteArrayInputStream(\"some text\".getBytes()));\n\n    // Printing a hash as a lowercase hex string\n    System.out.println(fileHash.toHexString(true));\n\n    // Printing a hash as an uppercase hex string\n    System.out.println(stringHash.toHexString());\n\n    // Getting the raw bytes of a hash\n    readerHash.getBytes();\n  }\n}\n----","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Flib-jvm-md5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxcapades%2Flib-jvm-md5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxcapades%2Flib-jvm-md5/lists"}