/*
 * matrix-java-sdk - Matrix Client SDK for Java
 * Copyright (C) 2017 Maxime Dor
 *
 * https://max.kamax.io/
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

package io.kamax.matrix.codec;

import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MxSha256 {

    private MessageDigest md;

    public MxSha256() {
        try {
            md = MessageDigest.getInstance("SHA-256");
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }
    }

    public String hash(String data) {
        return MxBase64.encode(md.digest(data.getBytes(StandardCharsets.UTF_8)));
    }

}

@@ -1215,22 +1215,22 @@
 ng hash(
-String
+byte%5B%5D
  data) %7B
@@ -1275,16 +1275,89 @@
 est(data
+));%0A    %7D%0A%0A    public String hash(String data) %7B%0A        return hash(data
 .getByte
@@ -1382,17 +1382,16 @@
 .UTF_8))
-)
 ;%0A    %7D%0A

Add ability to get SHA256 on bytes