{"id":23382228,"url":"https://github.com/sidoshi/sanitize-base32","last_synced_at":"2025-04-08T08:44:59.887Z","repository":{"id":66110912,"uuid":"194802980","full_name":"sidoshi/sanitize-base32","owner":"sidoshi","description":"Sanitize base32 encoded strings","archived":false,"fork":false,"pushed_at":"2019-07-02T06:51:20.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-01T14:21:14.537Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/sidoshi.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":"2019-07-02T06:35:46.000Z","updated_at":"2023-03-10T09:31:10.000Z","dependencies_parsed_at":"2023-04-18T08:05:14.107Z","dependency_job_id":null,"html_url":"https://github.com/sidoshi/sanitize-base32","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/sidoshi%2Fsanitize-base32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoshi%2Fsanitize-base32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoshi%2Fsanitize-base32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidoshi%2Fsanitize-base32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sidoshi","download_url":"https://codeload.github.com/sidoshi/sanitize-base32/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247808188,"owners_count":20999675,"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-12-21T21:19:01.880Z","updated_at":"2025-04-08T08:44:59.880Z","avatar_url":"https://github.com/sidoshi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sanitize base-32 encoded strings\n\nBase-32 strings only allow capital alphabets (A-Z), integers (2-7) and padding\nusing equals sign (=). This library can be used to sanitize an encoded base32\nstring to ensure that it can be safely decoded.\n\nThe default implementation strips all unsupported characters (including whitespace) and uses alias toreplace ambigious characters. This behaviour is configurable.\n\n## Install\n\n```bash\nnpm i sanitize-base32\n```\n\n## Usage\n\n```js\nimport {sanitize} from 'sanitize-base32'\n\nconsole.log(sanitize('AABA CDEF GGHU QQRL'))\n// =\u003e AABA CDEF GGHU QQRL\n\n```\n\n## API\n\n### sanitize(options?: Options): string\n\nTakes an optional `options` argument and returns a sanitized base-32 string.\n\n#### options.ignoreInvalid: boolean (default: true)\n\nBy default, when an invalid character is found, the sanitizer simply ignores it\nfrom the result. Setting this to false will raise an error instead.\n\n#### options.aliases: object | null (default: {0: 'O', 1: 'L', 8: 'B'})\n\nSpecify the aliases to use for ambigous unsupported characters. Alias checks\nare only performed for unsupported characters. If the character is a valid\nbase-32 character, it is given preference over alias.\n\nTo turn of aliases pass `null`. The aliases object must be a flat object mapping\nsingle character to a single character.\n\n#### options.removePadding: boolean (default: true)\n\nBase-32 strings are padded using `=` sign to allow assumptions about the size\nof the string. But that is not required for all use cases. By default, the\nsanitizer removes the padding. Set to `false` to preserve padding.\n\n## Licence\n\nMIT © [Siddharth Doshi](https://sid.sh)\n ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidoshi%2Fsanitize-base32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsidoshi%2Fsanitize-base32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidoshi%2Fsanitize-base32/lists"}