{"id":15801576,"url":"https://github.com/garrettmac/unique-hash","last_synced_at":"2025-04-21T08:31:45.290Z","repository":{"id":23259503,"uuid":"98560747","full_name":"garrettmac/unique-hash","owner":"garrettmac","description":null,"archived":false,"fork":false,"pushed_at":"2022-07-07T06:50:14.000Z","size":15,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-25T05:42:36.097Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/garrettmac.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":"2017-07-27T16:52:49.000Z","updated_at":"2024-04-17T19:34:38.000Z","dependencies_parsed_at":"2022-07-07T20:24:41.924Z","dependency_job_id":null,"html_url":"https://github.com/garrettmac/unique-hash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garrettmac%2Funique-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garrettmac%2Funique-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garrettmac%2Funique-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garrettmac%2Funique-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garrettmac","download_url":"https://codeload.github.com/garrettmac/unique-hash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250023525,"owners_count":21362414,"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-10-05T01:23:13.744Z","updated_at":"2025-04-21T08:31:45.058Z","avatar_url":"https://github.com/garrettmac.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  The best package to create hash ids.\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://standardjs.com/\"\u003e\u003cimg  src=\"https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"http://standardjs.com/\"\u003e\u003cimg  src=\"\thttps://img.shields.io/github/downloads/atom/atom/latest/total.svg\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/unique-hash\"\u003e\u003cimg alt=\"npm version\" src=\"http://img.shields.io/npm/v/unique-hash.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/unique-hash\"\u003e\u003cimg alt=\"npm version\" src=\"http://img.shields.io/npm/dm/unique-hash.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/garrettmac/unique-hash/pulls?q=is%3Apr+is%3Aclosed\"\u003e\u003cimg alt=\"PR Stats\" src=\"https://img.shields.io/issuestats/i/github/garrettmac/unique-hash.svg?style=flat-square\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/garrettmac/unique-hash/issues?q=is%3Aissue+is%3Aclosed\"\u003e\u003cimg alt=\"Issue Stats\" src=\"https://img.shields.io/issuestats/p/github/garrettmac/unique-hash.svg\" style=flat-square\"\u003e\u003c/a\u003e   \n \u003ca\u003e\u003cimg  src=\"https://img.shields.io/github/forks/garrettmac/unique-hash.svg\"/\u003e\u003c/a\u003e\n \u003ca\u003e\u003cimg  src=\"https://img.shields.io/github/stars/garrettmac/unique-hash.svg\"/\u003e\u003c/a\u003e\n \u003ca\u003e\u003cimg  src=\"https://img.shields.io/badge/license-MIT-blue.svg\"/\u003e\n \u003ca\u003e\u003cimg  src=\"https://img.shields.io/twitter/url/https/github.com/garrettmac/unique-hash.svg?style=social\"\u003e\u003c/a\u003e\n \u003ca href=\"https://gitter.im/garrettmac/unique-hash?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\"\u003e\u003cimg alt=\"Join the chat\" src=\"https://badges.gitter.im/garrettmac/unique-hash.svg\"\u003e\u003c/a\u003e\n\n\n\n\u003c/p\u003e\n\n\n\n\n# unique-hash\n\nUseful for saving to\n```javascript\nimport uniqueHash from \"unique-hash\"\n\n//or es5\n//var uniqueHash = require(\"unique-hash\").default\nlet url = \"https://www.npmjs.com/package/unique-hash\"\n\nuniqueHash(url)\n//\u003e\u003e output 88870086\n\nuniqueHash(url)\n//\u003e\u003e output 88870086\n\nuniqueHash(url,{format:\"string\"})\n//\u003e\u003e output \"iIIHaAIG\"\n\nuniqueHash(url,{format:\"string\"})\n//\u003e\u003e output \"iIIHaAIG\"\n\n\nuniqueHash(\"John H. Smith\")\n//\u003e\u003e output 983277668\nuniqueHash(\"John H Smith\")\n//\u003e\u003e output  983277668\nuniqueHash(\"JohnHSmith\")\n//\u003e\u003e output 983277668\n\n\nuniqueHash(\"John H. Smith\",{format:\"kebabCase\"})\n//\u003e\u003e output \"john-h-smith\"\nuniqueHash(\"John H Smith\",{format:\"kebabCase\"})\n//\u003e\u003e output \"john-h-smith\"\nuniqueHash(\"JohnHSmith\",{format:\"kebabCase\"})\n//\u003e\u003e output \"john-h-smith\"\n\n\nuniqueHash(url,{\n  prepend:\"articles\",\n  date:new Date(),\n })\n //\u003e\u003e output \"articles/2017/08/27/88870086\"\n\n\nuniqueHash(url,{\n  prepend:\"articles\",\n  append:\"videos\",\n  appendDate:\"hot\",\n  date:new Date(),\n  formatDate:\"YYYY/DD\",\n  format:\"string\"\n })\n //\u003e\u003e output \"articles/2017/08/hot/iIIHaAIG/videos\"\n\n```\n\n### Parameters\n\n| Parameter | Default | Description |\n|------|-----|-----|\n| format | \"number\" | options: \"number\", \"string\" or \"kebabCase\" |\n| prepend | \"\" | string to prepend output path  |\n| append | \"\" |string to append output path  |\n| appendDate | \"\" |  string to center between date and hash id  (eg. output `/YYYY/MM/DD/[HERE]/:hashId`) |\n| date | n/a | pass in date to append /YYYY/MM/DD to save path |\n| dateFormate | \"YYYY/MM/DD\" | Date format |\n| hashId | n/a | override the output hashId, useful if you want to use with date.  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarrettmac%2Funique-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarrettmac%2Funique-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarrettmac%2Funique-hash/lists"}