{"id":18865296,"url":"https://github.com/jonathanprince/url-hash","last_synced_at":"2026-02-12T09:30:18.030Z","repository":{"id":27395793,"uuid":"30872111","full_name":"JonathanPrince/url-hash","owner":"JonathanPrince","description":"Node library to add hash parameter for tamper-free urls","archived":false,"fork":false,"pushed_at":"2015-03-08T17:09:35.000Z","size":268,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-30T22:46:45.471Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JonathanPrince.png","metadata":{"files":{"readme":"README.md","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":"2015-02-16T14:37:37.000Z","updated_at":"2016-12-28T08:04:34.000Z","dependencies_parsed_at":"2022-09-26T16:22:17.467Z","dependency_job_id":null,"html_url":"https://github.com/JonathanPrince/url-hash","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/JonathanPrince%2Furl-hash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonathanPrince%2Furl-hash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonathanPrince%2Furl-hash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JonathanPrince%2Furl-hash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JonathanPrince","download_url":"https://codeload.github.com/JonathanPrince/url-hash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239809352,"owners_count":19700606,"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-11-08T04:46:34.691Z","updated_at":"2026-02-12T09:30:17.968Z","avatar_url":"https://github.com/JonathanPrince.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# url-hash\nNode library to add hash parameter for tamper-free urls\n\n**NOTE:**\nThis module is not intended for applications involving sensitive data.\nIt provides a simple restriction to avoid tampering with url parameters,\nor to add a basic expiry time to a link.\n\n## Basic Usage\n\n### Add hash to url\n\n```js\n\n// require library\nvar urlHash = require('url-hash');\n\nvar url = 'http://www.example.com/page?id=4';\n\n// add hash to url\nvar newUrl = urlHash.create(url);\n\n```\n\n### Verify Url\n\n```js\n\n// require library\nvar urlHash = require('url-hash');\n\n// check integrity of url\nvar result = urlHash.check('url/to/verify');\n\n/*\n\n  result will either:\n  1. equal true if the url is unchanged\n  2. equal false if the url has been changed\n\n*/\n\n// check can also use a callback\nurlHash.check('url/to/verify', function(res){\n  result = res;\n});\n\n```\n\n## Configuration options\n\nThis library currently offers the following configuration options:\n\n- salt\n- expire\n- hash key name\n- expire key name\n\n```js\n\nurlHash.config({\n                salt:    'someUniqueCustomSalt', // use custom salt\n                expire:  60000,                  // url expires after 1 minute\n                hashKey: 'myCustomHashKeyName',  // use custom name for hash parameter\n                expKey:  'myCustomExpiryName'    // custom name for expire parameter\n              });\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanprince%2Furl-hash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonathanprince%2Furl-hash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonathanprince%2Furl-hash/lists"}