SteamWar/SpigotCore
Archiviert
13
0

Merge remote-tracking branch 'origin/master' into packet-system

# Conflicts:
#	SpigotCore_Main/src/de/steamwar/sql/DownloadSchematic.java
Dieser Commit ist enthalten in:
Chaoscaot 2020-09-23 17:14:02 +02:00
Commit 00b9809cde

Datei anzeigen

@ -19,14 +19,14 @@
package de.steamwar.sql; package de.steamwar.sql;
import com.google.common.io.BaseEncoding;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.time.Instant; import java.time.Instant;
import javax.xml.bind.DatatypeConverter;
public class DownloadSchematic { public class DownloadSchematic {
private DownloadSchematic(){} private DownloadSchematic(){}
@ -49,7 +49,7 @@ public class DownloadSchematic {
} }
cript.reset(); cript.reset();
cript.update((Instant.now().toString() + schem.getSchemOwner() + schem.getSchemID()).getBytes()); cript.update((Instant.now().toString() + schem.getSchemOwner() + schem.getSchemID()).getBytes());
String hash = DatatypeConverter.printHexBinary(cript.digest()); String hash = BaseEncoding.base16().encode(cript.digest());
SQL.update("INSERT INTO SchemDownload (SchemID, Link) VALUES (?, ?)", schem.getSchemID(), hash); SQL.update("INSERT INTO SchemDownload (SchemID, Link) VALUES (?, ?)", schem.getSchemID(), hash);
return BASE + hash; return BASE + hash;
} }