{"id":22021899,"url":"https://github.com/knightchaser/urlshortener","last_synced_at":"2026-05-03T23:35:15.589Z","repository":{"id":225519620,"uuid":"766193933","full_name":"KnightChaser/urlshortener","owner":"KnightChaser","description":"A simple URL shortener inspired from \u003cSystem Design Interview\u003e","archived":false,"fork":false,"pushed_at":"2024-03-03T08:37:22.000Z","size":153,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T16:46:17.986Z","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/KnightChaser.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-02T15:40:34.000Z","updated_at":"2024-03-02T15:50:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"7e013414-6626-4dc6-ae7f-74f11286c695","html_url":"https://github.com/KnightChaser/urlshortener","commit_stats":null,"previous_names":["knightchaser/urlshortener"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightChaser%2Furlshortener","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightChaser%2Furlshortener/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightChaser%2Furlshortener/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KnightChaser%2Furlshortener/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KnightChaser","download_url":"https://codeload.github.com/KnightChaser/urlshortener/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245085835,"owners_count":20558475,"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-30T06:15:57.038Z","updated_at":"2026-05-03T23:35:10.568Z","avatar_url":"https://github.com/KnightChaser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# urlshortener\n![Express.js](https://img.shields.io/badge/express.js-%23404d59.svg?style=for-the-badge\u0026logo=express\u0026logoColor=%2361DAFB)\n![MySQL](https://img.shields.io/badge/mysql-%2300f.svg?style=for-the-badge\u0026logo=mysql\u0026logoColor=white)\n### A very very simple URL shortener inspired from `\u003cSystem Design Interview\u003e`\n\n### Appearances\n![1](./readme_pic/1.png)\n![2](./readme_pic/2.png)\n\n### Mechanism\n1. Do SHA256 hash URL\n2. Encode hashed URL to BASE62 encoding\n3. Cut the first 10 characters. The duplication probability is **1/62^10** = 1/839,299,365,868,340,224. The url will be like `W99EdQi0CY`\n4. Save that to the database and return the shortened URL to the user after appending the site domain like `knig.ht/W99EdQi0CY`. (Refer to `.env` file.)\n\nIt's a very simple and rough implementation, I just built it in only 3 hours. Of course, not for real production!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightchaser%2Furlshortener","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknightchaser%2Furlshortener","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknightchaser%2Furlshortener/lists"}