{"id":13418960,"url":"https://github.com/blueimp/JavaScript-MD5","last_synced_at":"2025-03-15T04:31:11.904Z","repository":{"id":2019355,"uuid":"2955178","full_name":"blueimp/JavaScript-MD5","owner":"blueimp","description":"JavaScript MD5 implementation. Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.","archived":true,"fork":false,"pushed_at":"2021-09-25T14:53:13.000Z","size":999,"stargazers_count":4556,"open_issues_count":2,"forks_count":1747,"subscribers_count":115,"default_branch":"master","last_synced_at":"2024-10-29T15:48:19.480Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://blueimp.github.io/JavaScript-MD5/","language":"JavaScript","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/blueimp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["blueimp"]}},"created_at":"2011-12-10T20:42:25.000Z","updated_at":"2024-10-29T03:20:35.000Z","dependencies_parsed_at":"2022-07-13T11:20:28.360Z","dependency_job_id":null,"html_url":"https://github.com/blueimp/JavaScript-MD5","commit_stats":null,"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueimp%2FJavaScript-MD5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueimp%2FJavaScript-MD5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueimp%2FJavaScript-MD5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blueimp%2FJavaScript-MD5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blueimp","download_url":"https://codeload.github.com/blueimp/JavaScript-MD5/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243685506,"owners_count":20330980,"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":[],"created_at":"2024-07-30T22:01:09.423Z","updated_at":"2025-03-15T04:31:11.570Z","avatar_url":"https://github.com/blueimp.png","language":"JavaScript","funding_links":["https://github.com/sponsors/blueimp"],"categories":["JavaScript"],"sub_categories":[],"readme":"# JavaScript MD5\n\n## Contents\n\n- [Demo](https://blueimp.github.io/JavaScript-MD5/)\n- [Description](#description)\n- [Usage](#usage)\n  - [Client-side](#client-side)\n  - [Server-side](#server-side)\n- [Requirements](#requirements)\n- [API](#api)\n- [Tests](#tests)\n- [License](#license)\n\n## Description\n\nJavaScript [MD5](https://en.wikipedia.org/wiki/MD5) implementation.  \nCompatible with server-side environments like [Node.js](https://nodejs.org/),\nmodule loaders like [RequireJS](https://requirejs.org/) or\n[webpack](https://webpack.js.org/) and all web browsers.\n\n## Usage\n\n### Client-side\n\nInstall the **blueimp-md5** package with [NPM](https://www.npmjs.org/):\n\n```sh\nnpm install blueimp-md5\n```\n\nInclude the (minified) JavaScript [MD5](https://en.wikipedia.org/wiki/MD5)\nscript in your HTML markup:\n\n```html\n\u003cscript src=\"js/md5.min.js\"\u003e\u003c/script\u003e\n```\n\nIn your application code, calculate the\n([hex](https://en.wikipedia.org/wiki/Hexadecimal)-encoded)\n[MD5](https://en.wikipedia.org/wiki/MD5) hash of a string by calling the **md5**\nmethod with the string as argument:\n\n```js\nvar hash = md5('value') // \"2063c1608d6e0baf80249c42e2be5804\"\n```\n\n### Server-side\n\nThe following is an example how to use the JavaScript MD5 module on the\nserver-side with [Node.js](https://nodejs.org/).\n\nInstall the **blueimp-md5** package with [NPM](https://www.npmjs.org/):\n\n```sh\nnpm install blueimp-md5\n```\n\nAdd a file **server.js** with the following content:\n\n```js\nrequire('http')\n  .createServer(function (req, res) {\n    // The md5 module exports the md5() function:\n    var md5 = require('./md5'),\n      // Use the following version if you installed the package with npm:\n      // var md5 = require(\"blueimp-md5\"),\n      url = require('url'),\n      query = url.parse(req.url).query\n    res.writeHead(200, { 'Content-Type': 'text/plain' })\n    // Calculate and print the MD5 hash of the url query:\n    res.end(md5(query))\n  })\n  .listen(8080, 'localhost')\nconsole.log('Server running at http://localhost:8080/')\n```\n\nRun the application with the following command:\n\n```sh\nnode server.js\n```\n\n## Requirements\n\nThe JavaScript MD5 script has zero dependencies.\n\n## API\n\nCalculate the ([hex](https://en.wikipedia.org/wiki/Hexadecimal)-encoded)\n[MD5](https://en.wikipedia.org/wiki/MD5) hash of a given string value:\n\n```js\nvar hash = md5('value') // \"2063c1608d6e0baf80249c42e2be5804\"\n```\n\nCalculate the ([hex](https://en.wikipedia.org/wiki/Hexadecimal)-encoded)\n[HMAC](https://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given string value and\nkey:\n\n```js\nvar hash = md5('value', 'key') // \"01433efd5f16327ea4b31144572c67f6\"\n```\n\nCalculate the raw [MD5](https://en.wikipedia.org/wiki/MD5) hash of a given\nstring value:\n\n```js\nvar hash = md5('value', null, true)\n```\n\nCalculate the raw [HMAC](https://en.wikipedia.org/wiki/HMAC)-MD5 hash of a given\nstring value and key:\n\n```js\nvar hash = md5('value', 'key', true)\n```\n\n## Tests\n\nThe JavaScript MD5 project comes with\n[Unit Tests](https://en.wikipedia.org/wiki/Unit_testing).  \nThere are two different ways to run the tests:\n\n- Open test/index.html in your browser or\n- run `npm test` in the Terminal in the root path of the repository package.\n\nThe first one tests the browser integration, the second one the\n[Node.js](https://nodejs.org/) integration.\n\n## License\n\nThe JavaScript MD5 script is released under the\n[MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueimp%2FJavaScript-MD5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblueimp%2FJavaScript-MD5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblueimp%2FJavaScript-MD5/lists"}