{"id":13498407,"url":"https://github.com/weihongyu12/egg-hashids","last_synced_at":"2025-03-29T01:30:36.931Z","repository":{"id":53544448,"uuid":"149281883","full_name":"weihongyu12/egg-hashids","owner":"weihongyu12","description":"Generate a short unique ID from the integer for egg.js","archived":false,"fork":false,"pushed_at":"2021-03-25T07:07:07.000Z","size":80,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-17T10:09:00.021Z","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/weihongyu12.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":"2018-09-18T12:06:20.000Z","updated_at":"2020-09-11T05:55:22.000Z","dependencies_parsed_at":"2022-08-24T17:41:23.847Z","dependency_job_id":null,"html_url":"https://github.com/weihongyu12/egg-hashids","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/weihongyu12%2Fegg-hashids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weihongyu12%2Fegg-hashids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weihongyu12%2Fegg-hashids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/weihongyu12%2Fegg-hashids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/weihongyu12","download_url":"https://codeload.github.com/weihongyu12/egg-hashids/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246125338,"owners_count":20727411,"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-31T21:00:27.553Z","updated_at":"2025-03-29T01:30:36.617Z","avatar_url":"https://github.com/weihongyu12.png","language":"JavaScript","funding_links":[],"categories":["Plugins"],"sub_categories":[],"readme":"# egg-hashids\n\n[![NPM version][npm-image]][npm-url]\n[![build status][travis-image]][travis-url]\n[![Test coverage][codecov-image]][codecov-url]\n[![David deps][david-image]][david-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n[![npm download][download-image]][download-url]\n\n[npm-image]: https://img.shields.io/npm/v/eggjs-hashids.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/eggjs-hashids\n[travis-image]: https://img.shields.io/travis/weihongyu12/egg-hashids.svg?style=flat-square\n[travis-url]: https://travis-ci.org/weihongyu12/egg-hashids\n[codecov-image]: https://img.shields.io/codecov/c/github/weihongyu12/egg-hashids.svg?style=flat-square\n[codecov-url]: https://codecov.io/github/weihongyu12/egg-hashids?branch=master\n[david-image]: https://img.shields.io/david/weihongyu12/egg-hashids.svg?style=flat-square\n[david-url]: https://david-dm.org/weihongyu12/egg-hashids\n[snyk-image]: https://snyk.io/test/npm/eggjs-hashids/badge.svg?style=flat-square\n[snyk-url]: https://snyk.io/test/npm/eggjs-hashids\n[download-image]: https://img.shields.io/npm/dm/eggjs-hashids.svg?style=flat-square\n[download-url]: https://npmjs.org/package/eggjs-hashids\n\n[Hashids](https://www.npmjs.com/package/hashids) is small JavaScript library to generate YouTube-like ids from numbers. Use it when you don't want to expose your database ids to the user.\n\n\u003e This plugin is only for [egg.js](https://eggjs.org/)\n\n## Install\n\n```bash\n$ npm i eggjs-hashids --save\n```\n\n## Usage\n\n```js\n// {app_root}/config/plugin.js\nexports.hashids = {\n  enable: true,\n  package: 'eggjs-hashids',\n};\n```\n\n## Configuration\n\n```javascript\n// {app_root}/config/config.default.js\nexports.hashids = {\n  salt: '',\n  minLength: 0,\n  alphabet: 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890',\n};\n```\n\nsee [config/config.default.js](config/config.default.js) and [hashids](https://www.npmjs.com/package/hashids) for more detail.\n\n## Example\n\n```javascript\nthis.app.hashids.encode(1);   // =\u003e 'jR'\nthis.app.hashids.decode('jR'); // =\u003e [ 1 ]\nthis.app.hashids.encodeHex('507f1f77bcf86cd799439011'); // =\u003e 'y42LW46J9luq3Xq9XMly'\nthis.app.hashids.decodeHex('y42LW46J9luq3Xq9XMly'); // =\u003e '507f1f77bcf86cd799439011'\n```\n\n## Questions \u0026 Suggestions\n\nPlease open an issue [here](https://github.com/weihongyu12/egg-hashids/issues).\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweihongyu12%2Fegg-hashids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweihongyu12%2Fegg-hashids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweihongyu12%2Fegg-hashids/lists"}