{"id":18937527,"url":"https://github.com/rollerworks/uri-encoder","last_synced_at":"2025-08-01T10:07:35.682Z","repository":{"id":18014039,"uuid":"21039266","full_name":"rollerworks/uri-encoder","owner":"rollerworks","description":"Provides a simple library, to safely encode a string for usage in a URI","archived":false,"fork":false,"pushed_at":"2023-11-05T10:42:15.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T01:04:45.770Z","etag":null,"topics":["compression","encoder","php","uri"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/rollerworks.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2014-06-20T13:43:38.000Z","updated_at":"2023-11-05T10:33:48.000Z","dependencies_parsed_at":"2024-11-08T12:11:46.500Z","dependency_job_id":"7bb875b5-de45-4fbb-a5cd-4155d0ac7e2c","html_url":"https://github.com/rollerworks/uri-encoder","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"3e7ff21cdb758a388dd8300fa039e4f6a0394acd"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollerworks%2Furi-encoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollerworks%2Furi-encoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollerworks%2Furi-encoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rollerworks%2Furi-encoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rollerworks","download_url":"https://codeload.github.com/rollerworks/uri-encoder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249129278,"owners_count":21217321,"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":["compression","encoder","php","uri"],"created_at":"2024-11-08T12:11:32.798Z","updated_at":"2025-04-15T18:32:10.842Z","avatar_url":"https://github.com/rollerworks.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿Rollerworks UriEncoder\n======================\n\nThis package provides the Rollerworks UriEncoder component, a simple library, \nto safely encode a string for usage in a URI. Plus a zlib compression.\n\n**Caution:**\n \n\u003e Do not use this library for encoding authorization/reset tokens, as this will leak information.\n\u003e Only use this library to transport \"public\" information, like a filtering preference.\n\u003e\n\u003e Use [paragonie/constant_time_encoding](https://github.com/paragonie/constant_time_encoding) \n\u003e for time-safe en/decoding. Don't use conversion caching or compression for sensitive information!\n\n## Installation\n\nTo install this package, add `rollerworks/search-uri-encoder` to your composer.json:\n\n```bash\n$ php composer.phar require rollerworks/search-uri-encoder\n```\n\nNow, [Composer][composer] will automatically download all required files,\nand install them for you.\n\n## Requirements\n\nYou need at least PHP 8.1, and optionally have support for gzip compression\nenabled.\n\nThis package has no other external dependencies.\n\n## Basic usage\n\nThe usage of this library is very straightforward, each encoder encodes and decodes\na URL string.\n\nTo encode a string for safe usage in a URL call `encodeUri()` on the encoder.\nTo decode an encoded string, to the original value call `decodeUri()` on the encoder.\n\n**Note:** The `decode()` method will silently ignore invalid data, \nand return null instead.\n\n### Base64UriEncoder\n\n```php\nuse Rollerworks\\Component\\UriEncoder\\Encoder as UriEncoder;\n\n$stringEncode = 'This string is not safe, for direct usage \u0026 must encoded';\n\n$base64Encoder = new UriEncoder\\Base64UriEncoder();\n\n$safeValue = $base64Encoder-\u003eencodeUri($stringEncode);\n// $safeValue now contains a base64 URI safe encoded string\n\n$originalValue = $base64Encoder-\u003edecodeUri($safeValue);\n```\n\n### Decorators\n\nTo keep the encoders small special features are provided in the form\nof object decorators.\n\nA decorator operates on top of the actual encoder.\n\n* `encodeUri()` modifies the value returned by the decorated encoder.\n* `decodeUri()` modifies the passed-in value before passing to the decorated encoder.\n\nThese decorators cannot be used as a stand-alone.\n\n#### GZipCompressionDecorator\n\nThe `GZipCompressionDecorator` (de)compresses URI data.\n\n**Caution:** The `GZipCompressionDecorator` creates a non-safe binary result,\nmake sure the original encoder supports this.\n\n```php\nuse Rollerworks\\Component\\UriEncoder\\Encoder as UriEncoder;\n\n$stringEncode = 'This string is not safe, for direct usage \u0026 must encoded';\n\n$base64Encoder = new UriEncoder\\Base64UriEncoder();\n$uriCompressor = new UriEncoder\\GZipCompressionDecorator($base64Encoder);\n\n$safeValue = $uriCompressor-\u003eencodeUri($stringEncode);\n// $safeValue now contains a base64 encoded URI safe string, which internally contains the compressed result.\n\n$originalValue = $uriCompressor-\u003edecodeUri($safeValue);\n```\n\nVersioning\n----------\n\nFor transparency and insight into the release cycle, and for striving\nto maintain backward compatibility, this package is maintained under\nthe Semantic Versioning guidelines as much as possible.\n\nReleases will be numbered with the following format:\n\n`\u003cmajor\u003e.\u003cminor\u003e.\u003cpatch\u003e`\n\nAnd constructed with the following guidelines:\n\n* Breaking backward compatibility bumps the major (and resets the minor and patch)\n* New additions without breaking backward compatibility bumps the minor (and resets the patch)\n* Bug fixes and misc changes bumps the patch\n\nFor more information on SemVer, please visit \u003chttp://semver.org/\u003e.\n\nLicense\n-------\n\nThis library is released under the [MIT license](LICENSE).\n\n## Contributing\n\nThis is an open source project. If you'd like to contribute,\nplease read the [Contributing Guidelines][contributing]. If you're submitting\na pull request, please follow the guidelines in the [Submitting a Patch][patches] section.ß\n\n[composer]: https://getcomposer.org/doc/00-intro.md\n[flex]: https://symfony.com/doc/current/setup/flex.html\n[contributing]: https://contributing.rollerscapes.net/\n[patches]: https://contributing.rollerscapes.net/latest/patches.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollerworks%2Furi-encoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frollerworks%2Furi-encoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frollerworks%2Furi-encoder/lists"}