public static byte[] getHash(String input){
        if(hasher == null){
            try {
                hasher = MessageDigest.getInstance("SHA-512");
            } catch (NoSuchAlgorithmException ex) {
                Logger.getLogger(Utility.class.getName()).log(Level.SEVERE, null, ex);
                return new byte[0];
            }
        }
        
        
        
        byte[] finalhash = {};
        hasher.reset();
        try {
            hasher.update(input.getBytes("UTF-8"));
            finalhash = hasher.digest();
            LOGGER.log(Level.FINEST, "Hashed {0} into {1}", new Object[]{input, finalhash});
        } catch (UnsupportedEncodingException ex) {
            hasher.update(input.getBytes());
            LOGGER.log(Level.SEVERE,"Incorrect encoding, trying with default. Full error"+ex.toString(),ex);
        }
        return finalhash;
    }