{"id":15030120,"url":"https://github.com/xp-forge/hashing","last_synced_at":"2026-04-04T06:38:17.153Z","repository":{"id":57084816,"uuid":"142602742","full_name":"xp-forge/hashing","owner":"xp-forge","description":"Hashing","archived":false,"fork":false,"pushed_at":"2024-06-23T19:26:05.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-12T23:02:12.465Z","etag":null,"topics":["hashing","md5","murmur3","php7","php8","sha1","sha256","sha512","xp-framework"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-forge.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","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":"2018-07-27T16:55:15.000Z","updated_at":"2024-06-23T19:25:49.000Z","dependencies_parsed_at":"2023-11-20T21:30:41.957Z","dependency_job_id":"0c8c35c8-2abb-4fc0-95bf-93b17e3a638a","html_url":"https://github.com/xp-forge/hashing","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fhashing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fhashing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fhashing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-forge%2Fhashing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-forge","download_url":"https://codeload.github.com/xp-forge/hashing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243307496,"owners_count":20270263,"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":["hashing","md5","murmur3","php7","php8","sha1","sha256","sha512","xp-framework"],"created_at":"2024-09-24T20:12:30.322Z","updated_at":"2025-12-28T08:05:40.512Z","avatar_url":"https://github.com/xp-forge.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Hashing\n=======\n\n[![Build status on GitHub](https://github.com/xp-forge/hashing/workflows/Tests/badge.svg)](https://github.com/xp-forge/hashing/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.4+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_4plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-forge/hashing/version.svg)](https://packagist.org/packages/xp-forge/hashing)\n\nFluent interface to hashing functions provided by PHP, extended with Murmur3.\n\nExamples\n--------\n\nCalculate hash for a string, output using base32:\n\n```php\nuse text\\hash\\Hashing;\n\n$hash= Hashing::murmur3_32()-\u003enew($seed= 0x2a);\n$base32= $hash-\u003edigest('The quick brown fox jumps over the lazy dog.')-\u003ebase32();\n```\n\nIncrementally updating hash, output hex (much like the builtin `md5()` function does):\n\n```php\nuse text\\hash\\Hashing;\n\n$hash= Hashing::md5()-\u003enew();\nwhile ($stream-\u003eavailable()) {\n  $hash-\u003eupdate($stream-\u003eread());\n}\n\n$hex= $hash-\u003edigest()-\u003ehex();\n```\n\nComparing hashes using constant time comparison:\n\n```php\nuse text\\hash\\{Hashing, HashCode};\n\n$computed= Hashing::sha256()-\u003edigest($req-\u003eparam('password')); // From request\n$stored= HashCode::fromHex($record['password_hash']);          // From database\n\nif ($computed-\u003eequals($stored)) {\n  // Not susceptible to timing attacks\n}\n```\n\nAlgorithms\n----------\nThe following algorithms exist as shortcuts inside the entry point class:\n\n* `Hashing::md5()`\n* `Hashing::sha1()`\n* `Hashing::sha256()`\n* `Hashing::sha512()`\n* `Hashing::murmur3_32()`\n* `Hashing::murmur3_128()`\n\n[Other algorithms](https://www.php.net/manual/en/function.hash-algos.php) can be instantiated via `Hashing::algorithm(string $name, var... $args)`, which may raise an *IllegalArgumentException* if the given algorithm is not available.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-forge%2Fhashing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-forge%2Fhashing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-forge%2Fhashing/lists"}