{"id":14111007,"url":"https://github.com/cotag/ts-md5","last_synced_at":"2025-04-12T21:33:54.215Z","repository":{"id":3923520,"uuid":"51340371","full_name":"cotag/ts-md5","owner":"cotag","description":"Typescript MD5 implemenation","archived":false,"fork":false,"pushed_at":"2023-03-04T02:29:27.000Z","size":1221,"stargazers_count":164,"open_issues_count":9,"forks_count":39,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-07T20:04:38.747Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/cotag.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,"governance":null}},"created_at":"2016-02-09T01:41:56.000Z","updated_at":"2025-03-12T12:16:09.000Z","dependencies_parsed_at":"2023-07-06T20:33:33.307Z","dependency_job_id":null,"html_url":"https://github.com/cotag/ts-md5","commit_stats":{"total_commits":70,"total_committers":11,"mean_commits":6.363636363636363,"dds":0.5857142857142856,"last_synced_commit":"d4787b36bc2f9edd008edf520d3c8ffe479bd044"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2Fts-md5","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2Fts-md5/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2Fts-md5/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cotag%2Fts-md5/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cotag","download_url":"https://codeload.github.com/cotag/ts-md5/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248636701,"owners_count":21137506,"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-08-14T10:03:06.196Z","updated_at":"2025-04-12T21:33:54.188Z","avatar_url":"https://github.com/cotag.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Introduction\n\nA MD5 implementation for TypeScript\n\n* Can handle Unicode strings\n* Supports incremental hashing\n* Works with Files and Blobs\n\nThis library also includes tools for:\n\n* Hashing a file or blob\n* A webworker for performing hashing\n* A webworker handler for requesting files or blobs to be hashed\n     * promise based\n     * files or blobs are queued for processing on the webworker\n\n\nBased on work by\n\n* Joseph Myers: http://www.myersdaily.org/joseph/javascript/md5-text.html\n* André Cruz: https://github.com/satazor/SparkMD5\n* Raymond Hill: https://github.com/gorhill/yamd5.js\n\n\n## Usage\n\n### Install\n\nInstall the node module with `npm install ts-md5`\n\n### Basic Hashing\n\n1. Import the class\n     * `import {Md5} from 'ts-md5';`\n2. Hash some things\n     * `Md5.hashStr('blah blah blah')` =\u003e hex:string\n     * `Md5.hashStr('blah blah blah', true)` =\u003e raw:Int32Array(4)\n     * `Md5.hashAsciiStr('blah blah blah')` =\u003e hex:string\n     * `Md5.hashAsciiStr('blah blah blah', true)` =\u003e raw:Int32Array(4)\n\nFor more complex uses:\n\n```typescript\n\nmd5 = new Md5();\n\n// Append incrementally your file or other input\n// Methods are chainable\nmd5.appendStr('somestring')\n    .appendAsciiStr('a different string')\n    .appendByteArray(blob);\n\n// Generate the MD5 hex string\nmd5.end();\n\n```\n\n\n### Hashing a File\n\nNOTE:: You have to make sure `ts-md5/dist/md5_worker.js` is made available in your build so it can be accessed directly by a browser\nIt should always remain as a seperate file.\n\n```typescript\n\nimport {ParallelHasher} from 'ts-md5';\n\nlet hasher = new ParallelHasher('/path/to/ts-md5/dist/md5_worker.js');\nhasher.hash(fileBlob).then(function(result) {\n   console.log('md5 of fileBlob is', result);\n});\n\n```\n\n\n## Building from src\n\nThe project is written in typescript and transpiled into ES5.\n\n1. Install TypeScript: `npm install -g typescript` (if you haven't already)\n2. Configure compile options in `tsconfig.json`\n3. Perform build using: `tsc`\n\nYou can find more information here: https://github.com/Microsoft/TypeScript/wiki/tsconfig.json\n\n## Scripts\n\n1. Build Script: `npm run build`\n2. Test Script: `npm run test`\n\n\n## Publishing\n\n1. Sign up to https://www.npmjs.com/\n2. Configure `package.json` https://docs.npmjs.com/files/package.json\n3. run `npm publish` https://docs.npmjs.com/cli/publish\n\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcotag%2Fts-md5","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcotag%2Fts-md5","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcotag%2Fts-md5/lists"}