{"id":13502379,"url":"https://github.com/fogleman/ShortUrl","last_synced_at":"2025-03-29T10:32:56.294Z","repository":{"id":14066263,"uuid":"16769591","full_name":"fogleman/ShortUrl","owner":"fogleman","description":"Python module for generating tiny URLs.","archived":false,"fork":false,"pushed_at":"2014-02-12T14:27:40.000Z","size":128,"stargazers_count":22,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-16T01:11:15.574Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/fogleman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-12T14:22:16.000Z","updated_at":"2022-11-05T05:53:10.000Z","dependencies_parsed_at":"2022-08-31T07:40:21.300Z","dependency_job_id":null,"html_url":"https://github.com/fogleman/ShortUrl","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/fogleman%2FShortUrl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogleman%2FShortUrl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogleman%2FShortUrl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogleman%2FShortUrl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fogleman","download_url":"https://codeload.github.com/fogleman/ShortUrl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246174207,"owners_count":20735406,"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-31T22:02:12.091Z","updated_at":"2025-03-29T10:32:55.946Z","avatar_url":"https://github.com/fogleman.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"## Short URL Generator\n\nPython module for generating tiny URLs.\n\n### Sample Usage\n\n    \u003e\u003e\u003e import short_url\n    \u003e\u003e\u003e short_url.encode_url(123)\n    '9epgb'\n    \u003e\u003e\u003e short_url.decode_url('9epgb')\n    123\n    \u003e\u003e\u003e short_url.encode_url(124)\n    '2yy2m'\n    \u003e\u003e\u003e short_url.decode_url('2yy2m')\n    124\n\n### Implementation Details\n\nA bit-shuffling approach is used to avoid generating URLs in a consecutive,\npredictable order. However, the algorithm is deterministic and guarantees that\nno collisions will occur.\n\nThe URL alphabet is fully customizable and may contain any number of\ncharacters. By default, digits and lower-case letters are used, with some\nremoved to avoid confusion between characters like o, O and 0. The default\nalphabet is shuffled and has a prime number of characters to further improve\nthe results of the algorithm.\n\nThe block size specifies how many bits will be shuffled. The lower BLOCK_SIZE \nbits are reversed. Any bits higher than BLOCK_SIZE will remain as is.\nBLOCK_SIZE of 0 will leave all bits unaffected and the algorithm will simply \nbe converting your integer to a different base. BLOCK_SIZE is necessary to\nestablish an upper-bound for the bit reversal and to generate the URLs at an\nappropriate length.\n\nThe intended use is that incrementing, consecutive integers will be used as \nkeys to generate the short URLs. For example, when creating a new URL, the \nunique integer ID assigned by a database could be used to generate the URL \nby using this module. Or a simple counter may be used. As long as the same \ninteger is not used twice, the same short URL will not be generated twice.\n\nThe module supports both encoding and decoding of URLs. The min_length \nparameter allows you to pad the URL if you want it to be a specific length.\n\nUse the functions in the top-level of the module to use the default encoder. \nOtherwise, you may create your own UrlEncoder object and use its encode_url \nand decode_url methods.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffogleman%2FShortUrl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffogleman%2FShortUrl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffogleman%2FShortUrl/lists"}