Add custom hex2bin implementation for 5.3

Fixes https://github.com/owncloud/core/issues/11004

@DeepDiver1975 Please check - unit tests are now passing locally for me.
Well, the unit test passed and that is what our 3rdparty libraries do in other places as well: https://github.com/owncloud/core/blob/fa333c02a0807c6e8347dd1c84381c3584997209/apps/files_external/3rdparty/aws-sdk-php/Aws/Common/Hash/HashUtils.php#L34