From 77a55f2f48ab6ea32299e16c4a2da21d4872af9e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 10 Jun 2015 18:56:57 +1200 Subject: Add more files to git ignore --- .gitignore | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 3fe98582b..fde2c462f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ -/target +target +nbactions.xml .classpath .project -.settings/ +.settings +web/.idea -- cgit v1.2.3 From ae56bc9e1f212bf96c3573b43fb8b11983bbb3e1 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 10 Jun 2015 19:21:31 +1200 Subject: Fix Hashing Java 6 support --- src/org/traccar/helper/Hashing.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/org/traccar/helper/Hashing.java b/src/org/traccar/helper/Hashing.java index 7e7579ede..3f3e30e6e 100644 --- a/src/org/traccar/helper/Hashing.java +++ b/src/org/traccar/helper/Hashing.java @@ -1,19 +1,20 @@ package org.traccar.helper; -import java.nio.charset.StandardCharsets; +import java.io.UnsupportedEncodingException; 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)); - + md.update(text.getBytes("UTF-8")); return md.digest(); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException(e); } } -- cgit v1.2.3