diff --git a/composer.json b/composer.json index 6321bbd..3462b3d 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,7 @@ "require": { "php": ">=5.6.0", "ext-openssl": "*", + "delight-im/base64": "^1.0", "delight-im/cookie": "^2.1", "delight-im/db": "^1.2" }, diff --git a/composer.lock b/composer.lock index 09f708a..84a67c7 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,49 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "c075bec19490fc0e972be01cdd02d59b", + "content-hash": "8ab7c9ad8ef2bc7d9a6beb27f9bf4df5", "packages": [ + { + "name": "delight-im/base64", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/delight-im/PHP-Base64.git", + "reference": "687b2a49f663e162030a8d27b32838bbe7f91c78" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/delight-im/PHP-Base64/zipball/687b2a49f663e162030a8d27b32838bbe7f91c78", + "reference": "687b2a49f663e162030a8d27b32838bbe7f91c78", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Delight\\Base64\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Simple and convenient Base64 encoding and decoding for PHP", + "homepage": "https://github.com/delight-im/PHP-Base64", + "keywords": [ + "URL-safe", + "base-64", + "base64", + "decode", + "decoding", + "encode", + "encoding", + "url" + ], + "time": "2017-07-24T18:59:51+00:00" + }, { "name": "delight-im/cookie", "version": "v2.1.2", diff --git a/src/Auth.php b/src/Auth.php index c798773..17527a8 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -8,6 +8,7 @@ namespace Delight\Auth; +use Delight\Base64\Base64; use Delight\Cookie\Cookie; use Delight\Cookie\Session; use Delight\Db\PdoDatabase; @@ -1154,7 +1155,7 @@ final class Auth extends UserManager { private static function hash($data) { $hashRaw = hash(self::IP_ADDRESS_HASH_ALGORITHM, $data, true); - return base64_encode($hashRaw); + return Base64::encode($hashRaw); } /** diff --git a/src/Base64.php b/src/Base64.php deleted file mode 100644 index a90a825..0000000 --- a/src/Base64.php +++ /dev/null @@ -1,34 +0,0 @@ -