{"id":25945503,"url":"https://github.com/seb-lewis/deno-imagehash","last_synced_at":"2026-05-09T01:39:54.505Z","repository":{"id":49902066,"uuid":"518383385","full_name":"seb-lewis/deno-imagehash","owner":"seb-lewis","description":"Perceptual JPEG image hashing for Deno via Blockhash.js","archived":false,"fork":false,"pushed_at":"2022-08-21T05:41:18.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-24T07:38:05.699Z","etag":null,"topics":["deno","deno-module","image","perceptual-hashing","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seb-lewis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-27T09:00:13.000Z","updated_at":"2022-07-27T09:12:42.000Z","dependencies_parsed_at":"2022-08-28T05:31:01.238Z","dependency_job_id":null,"html_url":"https://github.com/seb-lewis/deno-imagehash","commit_stats":null,"previous_names":["seb-lewis/deno-imagehash","smuudy/deno-imagehash"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/seb-lewis/deno-imagehash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seb-lewis%2Fdeno-imagehash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seb-lewis%2Fdeno-imagehash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seb-lewis%2Fdeno-imagehash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seb-lewis%2Fdeno-imagehash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seb-lewis","download_url":"https://codeload.github.com/seb-lewis/deno-imagehash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seb-lewis%2Fdeno-imagehash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32804525,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["deno","deno-module","image","perceptual-hashing","typescript"],"created_at":"2025-03-04T09:17:47.646Z","updated_at":"2026-05-09T01:39:54.474Z","avatar_url":"https://github.com/seb-lewis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# deno-imagehash\n\n\u003e Perceptual JPEG image hashing for Deno via Blockhash.js\n\n## Usage\n\n```javascript\nimport { imageHash, hammingDistance, DecodedImage } from \"https://deno.land/x/imagehash/mod.ts\";\n\nserve(async (request: Request) =\u003e {\n    const rawImageData: Uint8Array = request.body\n    const hash: String = await imageHash(rawImageData, 10);\n    \n    // OR\n    \n    const decodedImage: DecodedImage = jpeg.decode(rawImageData)  // decodedImage = { width: 100, height: 100, data: ... }\n    const hash: String = await imageHash(decodedImage, 10);\n    \n    // Hamming Distance\n    const bitDifference = hammingDistance(hash1, hash2); // returns number\n    \n    return new Response(JSON.stringify({hash, bitDifference}), {status: 200})\n\n```\n\n## API\n\n## imageHash(imgData, bits?)\nReturns: `string`\n\nReturns the hash value as a string of hexadecimal characters.\n\n### imgData \nType: `Uint8Array` or `DecodedImage`/`jpeg.Image`\n\nThe image data to hash. This can be a `Uint8Array` or an object that matches `DecodedImage`: ```{data: `Uint8Array`, width: `number`, height: `number`})```\n\n### bits = 10 \n#### (Optional)\n\nType: `number` / Default: 10\n\nThe number of bits to use for the hash. The higher the number, the more accurate the hash, but\nthe longer it will take to compute.\n\n## hammingDistance(hash1, hash2)\nCalculate distance in bits between two hashes.\n\n## Credits\n\nThis module uses the following projects with some changes to work with Deno:\n\n- [Blockhash.js](https://github.com/commonsmachinery/blockhash-js)\n\n- [jpeg.ts](https://github.com/fakoua/jpeg.ts)\n\nInspired by: [deno-image](https://github.com/MariusVatasoiu/deno-image)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseb-lewis%2Fdeno-imagehash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseb-lewis%2Fdeno-imagehash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseb-lewis%2Fdeno-imagehash/lists"}