aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIrving Gonzalez <ialexis93@gmail.com>2015-06-10 11:24:49 -0600
committerIrving Gonzalez <ialexis93@gmail.com>2015-06-10 11:24:49 -0600
commita024db7609997039e71b5369496b3e8e687a130b (patch)
tree5c7d8a5c668bffe604a1c35594a170984b944f8b
parentd8f950b6b90f3ce144fd2ae78184844ffbacc9b7 (diff)
parentae56bc9e1f212bf96c3573b43fb8b11983bbb3e1 (diff)
downloadtrackermap-server-a024db7609997039e71b5369496b3e8e687a130b.tar.gz
trackermap-server-a024db7609997039e71b5369496b3e8e687a130b.tar.bz2
trackermap-server-a024db7609997039e71b5369496b3e8e687a130b.zip
Merge branch 'master' of https://github.com/tananaev/traccar
-rw-r--r--.gitignore6
-rw-r--r--src/org/traccar/helper/Hashing.java9
2 files changed, 9 insertions, 6 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
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);
}
}