@VisibleForTesting
    public static String encodeHash(String hash) {
        return Base64.getEncoder().encodeToString(StringUtils.decodeHex(hash));
    }
Generates a 'ver' hash attribute used in validation to help prevent
poisoning of entity capabilities information.

@see #isValid(IQ)

The value of the 'ver' attribute is generated according to the method
outlined in XEP-0115.

@param packet IQ reply to the entity cap request.
@param algorithm The hashing algorithm to use (e.g. SHA-1)
@return the generated 'ver' hash
xmppserver/src/main/java/org/jivesoftware/openfire/entitycaps/EntityCapabilitiesManager.java