Base64Encoder.php 623 B

123456789101112131415161718192021222324252627
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of qbhy/simple-jwt.
  5. *
  6. * @link https://github.com/qbhy/simple-jwt
  7. * @document https://github.com/qbhy/simple-jwt/blob/master/README.md
  8. * @contact qbhy0715@qq.com
  9. * @license https://github.com/qbhy/simple-jwt/blob/master/LICENSE
  10. */
  11. namespace Qbhy\SimpleJwt\Encoders;
  12. use Qbhy\SimpleJwt\Interfaces\Encoder;
  13. class Base64Encoder implements Encoder
  14. {
  15. public function encode(string $string): string
  16. {
  17. return base64_encode($string);
  18. }
  19. public function decode(string $string): string
  20. {
  21. return base64_decode($string);
  22. }
  23. }