package org.traccar.helper;

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

public class Hashing {

    public static byte[] sha256(String text) {
        try {
            MessageDigest md = MessageDigest.getInstance("SHA-256");
            md.update(text.getBytes(StandardCharsets.UTF_8));

            return md.digest();
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }
    }

}

@@ -38,36 +38,39 @@
 ava.
-n
 io.
-charset.StandardCharsets
+UnsupportedEncodingException
 ;%0Aim
@@ -174,16 +174,20 @@
 shing %7B%0A
+    
 %0A    pub
@@ -349,35 +349,19 @@
 tes(
-StandardCharsets.UTF_8
+%22UTF-8%22
 ));%0A
-%0A
     
@@ -478,16 +478,110 @@
 ion(e);%0A
+        %7D catch (UnsupportedEncodingException e) %7B%0A            throw new RuntimeException(e);%0A
         

Fix Hashing Java 6 support