From 6093f26fb6b9fdbb4d393d4eeaa8626c7498d5a1 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Fri, 16 Dec 2016 17:58:16 +0000 Subject: [PATCH] minor cleanup --- .../src/net/i2p/data/router/RouterKeyGenerator.java | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/router/java/src/net/i2p/data/router/RouterKeyGenerator.java b/router/java/src/net/i2p/data/router/RouterKeyGenerator.java index 0f71c1b513..a099d062ab 100644 --- a/router/java/src/net/i2p/data/router/RouterKeyGenerator.java +++ b/router/java/src/net/i2p/data/router/RouterKeyGenerator.java @@ -19,6 +19,7 @@ import java.util.TimeZone; import net.i2p.I2PAppContext; import net.i2p.crypto.SHA256Generator; +import net.i2p.data.DataHelper; import net.i2p.data.Hash; import net.i2p.data.RoutingKeyGenerator; import net.i2p.util.HexDump; @@ -130,9 +131,7 @@ public class RouterKeyGenerator extends RoutingKeyGenerator { String modVal = _fmt.format(today); if (modVal.length() != LENGTH) throw new IllegalStateException(); - byte[] mod = new byte[LENGTH]; - for (int i = 0; i < LENGTH; i++) - mod[i] = (byte)(modVal.charAt(i) & 0xFF); + byte[] mod = DataHelper.getASCII(modVal); return mod; } @@ -199,10 +198,7 @@ public class RouterKeyGenerator extends RoutingKeyGenerator { } if (modVal.length() != LENGTH) throw new IllegalStateException(); - byte[] mod = new byte[LENGTH]; - for (int i = 0; i < LENGTH; i++) { - mod[i] = (byte)(modVal.charAt(i) & 0xFF); - } + byte[] mod = DataHelper.getASCII(modVal); return getKey(origKey, mod); } -- GitLab