{"id":18748009,"url":"https://github.com/emileperron/universal-identifier","last_synced_at":"2025-11-25T02:30:26.367Z","repository":{"id":56977383,"uuid":"331994463","full_name":"EmilePerron/universal-identifier","owner":"EmilePerron","description":"Provides a universal_identifier function, which generates a unique sha256 identifier for a provided primitive, object, or array.","archived":false,"fork":false,"pushed_at":"2021-01-22T16:23:40.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-20T09:09:49.618Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/EmilePerron.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}},"created_at":"2021-01-22T16:02:26.000Z","updated_at":"2021-01-22T16:23:42.000Z","dependencies_parsed_at":"2022-08-21T08:10:54.454Z","dependency_job_id":null,"html_url":"https://github.com/EmilePerron/universal-identifier","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/EmilePerron/universal-identifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmilePerron%2Funiversal-identifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmilePerron%2Funiversal-identifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmilePerron%2Funiversal-identifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmilePerron%2Funiversal-identifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EmilePerron","download_url":"https://codeload.github.com/EmilePerron/universal-identifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EmilePerron%2Funiversal-identifier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286079811,"owners_count":27282121,"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","status":"online","status_checked_at":"2025-11-25T02:00:05.816Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-07T16:32:20.182Z","updated_at":"2025-11-25T02:30:26.096Z","avatar_url":"https://github.com/EmilePerron.png","language":"PHP","readme":"# PHP universal identifiers\n## Generate unique identifiers for your PHP primitives, arrays and objects\n\nThis tiny composer package provides a `universal_identifier()` global function, which can be used to generate sha256 identifiers for values and arrays/objects.\n\nThese identifiers can be used to easily compare configurations both in code and in database queries, without having to manually sort and compare every items and sub-items inside an array or an object.\n\n## Getting started\nTo get started, simply require the package via Composer:\n\n```\ncomposer require emileperron/universal-identifier\n```\n\nOnce that's done, you can start using the `universal_identifier` function in your project. Here's a very brief overview of the library's usage and functionalities:\n\n**Usage with primitives:**\n```php\n\u003c?php\n// This will output the string's identifier: \"de719c460cc38eddfb39fe286882a042be247e5d091fd8e4aed01daf9d3a5513\"\necho universal_identifier(\"my string\");\n\n// Same thing goes for all primitives;\necho universal_identifier(150); // \"7d3c18bc20c238917421291209ad0d17c83be19e4c214abcf09160af2949f591\"\necho universal_identifier(0.55f); // \"1c3d577cd8a09945100ac46c061835db1691907bc40f01931d5083ec7fb69def\"\n// etc...\n```\n\n**Usage with arrays:**\n```php\n\u003c?php\n$yourArray = [\n\t\"foo\" =\u003e \"bar\",\n\t\"foos\" =\u003e [\n\t\t\"bar1\", \n\t\t\"bar2\"\n\t],\n\t\"anotherKey\" =\u003e \"value\",\n];\n\n// This will output the array's identifier: \"7ef0675c80dd9ae9f9fed4a786f8c0641d14a646cc580de1690f62a803e54f89\"\necho universal_identifier($yourArray);\n\n// Even if you change the order of the array's keys, the identifier will remain the same (this does not apply to numerically-indexed arrays, where the order actually matters).\n// Ex.:\nksort($yourArray);\n// This will still output the same identifier: \"7ef0675c80dd9ae9f9fed4a786f8c0641d14a646cc580de1690f62a803e54f89\"\necho universal_identifier($yourArray);\n```\n\n## Contributing\nFeel free to submit pull requests on [the GitHub repository](https://github.com/EmilePerron/universal-identifier) if you want to add functionalities or suggest improvements to this library. I will look them over and merge them as soon as possible.\n\nYou can also submit issues if you run into problems but don't have time to implement a fix.\n\n## Supporting\nFinally, if you use the library and would like to support me, here are the ways you can do that:\n\n- Saying thanks directly on Twitter: [@cunrakes](https://twitter.com/cunrakes)\n- Giving this repository a star [on GitHub](https://github.com/EmilePerron/universal-identifier)\n- Taking a look at my other projects [on my website](https://www.emileperron.com)\n- [Buying me a cup of tea](https://www.buymeacoffee.com/EmilePerron) ☕️\n","funding_links":["https://www.buymeacoffee.com/EmilePerron"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femileperron%2Funiversal-identifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femileperron%2Funiversal-identifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femileperron%2Funiversal-identifier/lists"}