diff options
author | Irving Gonzalez <ialexis93@gmail.com> | 2015-06-10 11:24:49 -0600 |
---|---|---|
committer | Irving Gonzalez <ialexis93@gmail.com> | 2015-06-10 11:24:49 -0600 |
commit | a024db7609997039e71b5369496b3e8e687a130b (patch) | |
tree | 5c7d8a5c668bffe604a1c35594a170984b944f8b /src/org | |
parent | d8f950b6b90f3ce144fd2ae78184844ffbacc9b7 (diff) | |
parent | ae56bc9e1f212bf96c3573b43fb8b11983bbb3e1 (diff) | |
download | trackermap-server-a024db7609997039e71b5369496b3e8e687a130b.tar.gz trackermap-server-a024db7609997039e71b5369496b3e8e687a130b.tar.bz2 trackermap-server-a024db7609997039e71b5369496b3e8e687a130b.zip |
Merge branch 'master' of https://github.com/tananaev/traccar
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/helper/Hashing.java | 9 |
1 files 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); } } |