{"id":24280741,"url":"https://github.com/willdera/strdiff","last_synced_at":"2025-03-05T13:41:48.146Z","repository":{"id":170121373,"uuid":"644011525","full_name":"WillDera/strdiff","owner":"WillDera","description":"Strdiff is a library for calculating string differences. It leverages efficient algorithms such as the Levenshtein distance and the Damerau-Levenshtein distance.","archived":false,"fork":false,"pushed_at":"2023-06-11T16:34:58.000Z","size":22,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-16T02:26:12.523Z","etag":null,"topics":["algorithm","damerau-levenshtein","levenshtein-distance","rust","wapm","wasmer"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/WillDera.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-22T16:08:42.000Z","updated_at":"2023-06-28T06:05:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"1ce200be-4b74-4a19-bd6f-1058a4dcef43","html_url":"https://github.com/WillDera/strdiff","commit_stats":null,"previous_names":["willdera/strdiff"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WillDera%2Fstrdiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WillDera%2Fstrdiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WillDera%2Fstrdiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WillDera%2Fstrdiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WillDera","download_url":"https://codeload.github.com/WillDera/strdiff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242038839,"owners_count":20061920,"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","damerau-levenshtein","levenshtein-distance","rust","wapm","wasmer"],"created_at":"2025-01-16T02:25:38.825Z","updated_at":"2025-03-05T13:41:48.141Z","avatar_url":"https://github.com/WillDera.png","language":"Rust","readme":"# Strdiff\n\nStrdiff is a library for calculating string differences. It leverages efficient algorithms such as the Levenshtein distance and the Damerau-Levenshtein distance.\n\n## How to use:\n*NOTE:* This requires a language that [supports WebAssembly](https://docs.wasmer.io/)\n\n- [Install wasmer](https://docs.wasmer.io/ecosystem/wasmer/getting-started)\n\n### Yarn/NPM example\n- Install wapm package to yarn project\n`wasmer add --yarn willdera/strdiff`\n\n- Install wapm package to npm project\n`wasmer add --npm willdera/strdiff`\n\n- Import and use\n```js\n// index.js\nimport {bindings} from \"@willdera/strdiff\";\n\nasync function main() {\n    const strdiff = await bindings.strdiff();\n    \n    // tag: 0 -\u003e string\n    // tag: 1 -\u003e Vector of string\n    let strdiff_check = strdiff.lvd({tag: 0, val: \"Hello\"}, {tag: 0, val: \"Hella\"});\n    \n    // tag: \"ok\" -\u003e Successful execution\n    // tag: \"err\" -\u003e Failed execution\n    console.log(strdiff_check); // { tag: 'ok', val: { tag: 0, val: 1 } }\n}\n```\n The example above returns a Levenshtein distance of 1, represented as `val: 1` in `{ tag: 0, val: 1 }`\n\n*NOTE:* The example above showcases Levenshtein distance, same approach can be followed for Damerau-Levenshtein distance by replacing `strdiff.lvd(...)` with `strdiff.dlvd(...)`, same argument data-types would work.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilldera%2Fstrdiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilldera%2Fstrdiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilldera%2Fstrdiff/lists"}