{"id":15008625,"url":"https://github.com/ftognetto/alphanum_comparator","last_synced_at":"2025-04-09T16:07:24.802Z","repository":{"id":56825863,"uuid":"268256259","full_name":"ftognetto/alphanum_comparator","owner":"ftognetto","description":"Porting of \"The Alphanum Algorithm\" in Dart, used to sort string lists alphanumerically.","archived":false,"fork":false,"pushed_at":"2025-03-06T10:45:30.000Z","size":20,"stargazers_count":5,"open_issues_count":3,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T16:07:10.164Z","etag":null,"topics":["algorithm","dart","sort","sorting","sorting-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ftognetto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-05-31T10:24:06.000Z","updated_at":"2025-03-06T10:45:34.000Z","dependencies_parsed_at":"2022-09-20T22:46:18.029Z","dependency_job_id":null,"html_url":"https://github.com/ftognetto/alphanum_comparator","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/ftognetto%2Falphanum_comparator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftognetto%2Falphanum_comparator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftognetto%2Falphanum_comparator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftognetto%2Falphanum_comparator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ftognetto","download_url":"https://codeload.github.com/ftognetto/alphanum_comparator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065286,"owners_count":21041871,"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":["algorithm","dart","sort","sorting","sorting-algorithms"],"created_at":"2024-09-24T19:19:45.529Z","updated_at":"2025-04-09T16:07:24.773Z","avatar_url":"https://github.com/ftognetto.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# alphanum_comparator\n\nPorting of \"The Alphanum Algorithm\" in Dart.\n\n# The Problem\nLook at most sorted list of filenames, product names, or any other text that contains alphanumeric characters - both letters and numbers. Traditional sorting algorithms use ASCII comparisons to sort these items, which means the end-user sees an unfortunately ordered list that does not consider the numeric values within the strings.\n\nFor example, in a sorted list of files, \"z100.html\" is sorted before \"z2.html\". But obviously, 2 comes before 100!\n\nSorting algorithms should sort alphanumeric strings in the order that users would expect, especially as software becomes increasingly used by nontechnical people. Besides, it's the 21st Century; software engineers can do better than this.\n\n# The Solution\nI created the Alphanum Algorithm to solve this problem. The Alphanum Algorithm sorts strings containing a mix of letters and numbers. Given strings of mixed characters and numbers, it sorts the numbers in value order, while sorting the non-numbers in ASCII order. The end result is a natural sorting order.\n\nHere's a list of sample filenames to illustrate the difference between sorting with the Alphanum algorithm and traditional ASCII sort. On the left is what you live with on a daily basis. On the right is what you could have, if more developers were motivated to sort lists as people would expect. Which list makes more sense to you? Which would be more comfortable to you as you're using an application?\n\nTraditional\t \t\nz1.doc\nz10.doc\nz100.doc\nz101.doc\nz102.doc\nz11.doc\nz12.doc\nz13.doc\nz14.doc\nz15.doc\nz16.doc\nz17.doc\nz18.doc\nz19.doc\nz2.doc\nz20.doc\nz3.doc\nz4.doc\nz5.doc\nz6.doc\nz7.doc\nz8.doc\nz9.doc\n        \nAlphanum\nz1.doc\nz2.doc\nz3.doc\nz4.doc\nz5.doc\nz6.doc\nz7.doc\nz8.doc\nz9.doc\nz10.doc\nz11.doc\nz12.doc\nz13.doc\nz14.doc\nz15.doc\nz16.doc\nz17.doc\nz18.doc\nz19.doc\nz20.doc\nz100.doc\nz101.doc\nz102.doc\n        \nSee http://www.davekoelle.com/alphanum.html for details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftognetto%2Falphanum_comparator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fftognetto%2Falphanum_comparator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftognetto%2Falphanum_comparator/lists"}