{"id":22021518,"url":"https://github.com/lamansky/secure-shuffle","last_synced_at":"2026-05-02T09:35:45.197Z","repository":{"id":57010873,"uuid":"288276481","full_name":"lamansky/secure-shuffle","owner":"lamansky","description":"Reorders array elements using cryptographically-secure randomization.","archived":false,"fork":false,"pushed_at":"2020-08-17T20:28:36.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T15:16:51.929Z","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/lamansky.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-17T20:09:51.000Z","updated_at":"2024-03-21T05:37:13.000Z","dependencies_parsed_at":"2022-08-21T15:10:32.678Z","dependency_job_id":null,"html_url":"https://github.com/lamansky/secure-shuffle","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fsecure-shuffle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fsecure-shuffle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fsecure-shuffle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lamansky%2Fsecure-shuffle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lamansky","download_url":"https://codeload.github.com/lamansky/secure-shuffle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245084995,"owners_count":20558320,"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-11-30T06:12:32.400Z","updated_at":"2026-05-02T09:35:45.098Z","avatar_url":"https://github.com/lamansky.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SecureShuffle\n\nA PHP library for reordering array elements using cryptographically-secure randomization.\n\n## Installation\n\nWith [Composer](http://getcomposer.org) installed on your computer and initialized for your project, run this command in your project’s root directory:\n\n```bash\ncomposer require lamansky/secure-shuffle\n```\n\nRequires PHP 7.1 or above.\n\n## Examples\n\nThe library makes 4 functions available for import. Here is an example with all four functions in use:\n\n```php\n\u003c?php\nuse function Lamansky\\SecureShuffle\\shuffle;\nuse function Lamansky\\SecureShuffle\\shuffle_assoc;\nuse function Lamansky\\SecureShuffle\\shuffled;\nuse function Lamansky\\SecureShuffle\\shuffled_assoc;\n\n// Shuffles an indexed array in-place.\n// Note that we are using the imported shuffle() function,\n// not the built-in \\shuffle() function.\n$arr = [1, 2, 3, 4, 5];\nshuffle($arr);\nprint_r($arr); // Array ( [0] =\u003e 4 [1] =\u003e 5 [2] =\u003e 2 [3] =\u003e 1 [4] =\u003e 3 )\n\n// Shuffles an associative array in-place.\n$arr = ['a' =\u003e 1, 'b' =\u003e 2, 'c' =\u003e 3];\nshuffle_assoc($arr);\nprint_r($arr); // Array ( [b] =\u003e 2 [a] =\u003e 1 [c] =\u003e 3 )\n\n// Creates a shuffled copy of an indexed array.\n$orig = [1, 2, 3, 4, 5];\n$copy = shuffled($orig);\nprint_r($orig); // Array ( [0] =\u003e 1 [1] =\u003e 2 [2] =\u003e 3 [3] =\u003e 4 [4] =\u003e 5 )\nprint_r($copy); // Array ( [0] =\u003e 5 [1] =\u003e 2 [2] =\u003e 4 [3] =\u003e 3 [4] =\u003e 1 )\n\n// Creates a shuffled copy of an associative array.\n$orig = ['a' =\u003e 1, 'b' =\u003e 2, 'c' =\u003e 3];\n$copy = shuffled_assoc($orig);\nprint_r($orig); // Array ( [a] =\u003e 1 [b] =\u003e 2 [c] =\u003e 3 )\nprint_r($copy); // Array ( [c] =\u003e 3 [a] =\u003e 1 [b] =\u003e 2 )\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamansky%2Fsecure-shuffle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flamansky%2Fsecure-shuffle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flamansky%2Fsecure-shuffle/lists"}