Security.php 631 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Encryption\Helper;
  7. use Zend\Crypt\Utils;
  8. /**
  9. * Class implements compareString from Zend\Crypt
  10. *
  11. * @api
  12. * @since 100.0.2
  13. */
  14. class Security
  15. {
  16. /**
  17. * Compare two strings in a secure way that avoids string length guessing based on duration of calculation
  18. *
  19. * @param string $expected
  20. * @param string $actual
  21. * @return bool
  22. */
  23. public static function compareStrings($expected, $actual)
  24. {
  25. return Utils::compareStrings($expected, $actual);
  26. }
  27. }