use core StringUtils to compare hashes
minor #10311 use core StringUtils to compare hashes (steelywing)

This PR was merged into the 2.5-dev branch.

Discussion
----------

use core StringUtils to compare hashes

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

9fc01d2 use core StringUtils to compare hashes
[Security] simplified code
[Debug] enhance non-PSR-0 compatibility for case mismatch test