{"id":16978782,"url":"https://github.com/srph/jelai.php-hashing","last_synced_at":"2026-05-18T02:31:17.122Z","repository":{"id":27813706,"uuid":"31303206","full_name":"srph/jelai.php-hashing","owner":"srph","description":"jelai.php Hashing abstraction","archived":false,"fork":false,"pushed_at":"2015-02-27T03:23:18.000Z","size":228,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-01T06:15:49.059Z","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/srph.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":"2015-02-25T08:01:09.000Z","updated_at":"2015-02-27T03:23:18.000Z","dependencies_parsed_at":"2022-07-24T15:17:04.678Z","dependency_job_id":null,"html_url":"https://github.com/srph/jelai.php-hashing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/srph/jelai.php-hashing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srph%2Fjelai.php-hashing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srph%2Fjelai.php-hashing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srph%2Fjelai.php-hashing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srph%2Fjelai.php-hashing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srph","download_url":"https://codeload.github.com/srph/jelai.php-hashing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srph%2Fjelai.php-hashing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33162603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"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-10-14T01:44:11.746Z","updated_at":"2026-05-18T02:31:17.098Z","avatar_url":"https://github.com/srph.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jelai.php-hashing\n\njelai.php Hashing abstraction\n\n## What is jelai.php?\n\nPlease see this [gist](https://gist.github.com/srph/2e2d51d46dadfdbc38e3).\n\n## Usage\n\nThe package provides a built-in for *md5*.\n\n```php\nrequire __DIR__ . '/path/to/src/SRPH/Jelai/Hashing/MD5Hasher.php';\n$hasher = new SRPH\\Jelai\\Hashing\\MD5Hasher;\n$hasher-\u003emake('123'); // '202cb962ac59075b964b07152d234b70'\n$hasher-\u003echeck('123', '202cb962ac59075b964b07152d234b70') // true\n```\n\nThe abstraction simply provides an interface (```HashingInterface```).\n\n```php\n\u003c?php namespace MyApp\\Hashing;\n\nuse SRPH\\Jelai\\Hashing\\HashingInterface;\n\nclass BcryptHasher implements HashingInterface {\n\t\n\tpublic function make()\n\t{\n\t\t//\n\t}\n\t\n\tpublic function check()\n\t{\n\t\t//\n\t}\n}\n```\n\nIt's much more appreciated when paired with an *IoC Container*, wherein you can *dependency inject* objects. For instance, in Laravel, you can bind interfaces to a class when called, like so:\n\n```php\n# Laravel 4.x\n\u003c?php namespace MyApp\\Hashing;\n\nuse MyApp\\Hashing\\BcryptHasher;\nuse Illuminate\\Support\\ServiceProvider;\n\nclass HashingServiceProvider extends ServiceProvider {\n\t\n\t/**\n\t * Bind `SRPH\\Jelai\\Hashing\\HashingInterface` to `MyApp\\Hashing\\BycryptHasher`\n\t */\n\tpublic function register()\n\t{\n\t\t$this-\u003eapp-\u003ebind('SRPH\\Jelai\\Hashing\\HashingInterface', 'MyApp\\Hashing\\BycryptHasher');\n\t}\n}\n```\n\n\\* *This hashing abstraction is mostly a mimic of Laravel's hashing abstraction.*\n\n## API\n\n#### ```HashingInterface```\n\nThe interface requires to have methods ```make``` and ```check```.\n\n- ```make``` (```$value```, *```array```* ```$options```);\n\nHash the provided value.\n\n```returns```: ```string``` (the hashed value). \n\n- ```check``` (```$value```, ```$hashedValue```, *```array```* ```$options```)\n\nChecks if the provided *value* and *hashed value* (```$hashedValue```) is equal.\n\n```returns```: ```boolean``\n\n\\* *Check the example, [MD5Hasher](https://github.com/srph/jelai.php-hashing/blob/master/src/SRPH/Jelai/Hashing/MD5Hasher.php).*\n\n## Acknowledgement\n\n**jelai.php-hashing** © 2015+, Kier Borromeo (srph). **jelai.php** is released under the [MIT](mit-license.org) license.\n\n\u003e [srph.github.io](http://srph.github.io) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e GitHub [@srph](https://github.com/srph) \u0026nbsp;\u0026middot;\u0026nbsp;\n\u003e Twitter [@_srph](https://twitter.com/_srph)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrph%2Fjelai.php-hashing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrph%2Fjelai.php-hashing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrph%2Fjelai.php-hashing/lists"}