Changeset 6093f26


Ignore:
Timestamp:
Dec 16, 2016 5:58:16 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
636badc
Parents:
4615fce
Message:

minor cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/data/router/RouterKeyGenerator.java

    r4615fce r6093f26  
    2020import net.i2p.I2PAppContext;
    2121import net.i2p.crypto.SHA256Generator;
     22import net.i2p.data.DataHelper;
    2223import net.i2p.data.Hash;
    2324import net.i2p.data.RoutingKeyGenerator;
     
    131132        if (modVal.length() != LENGTH)
    132133            throw new IllegalStateException();
    133         byte[] mod = new byte[LENGTH];
    134         for (int i = 0; i < LENGTH; i++)
    135             mod[i] = (byte)(modVal.charAt(i) & 0xFF);
     134        byte[] mod = DataHelper.getASCII(modVal);
    136135        return mod;
    137136    }
     
    200199        if (modVal.length() != LENGTH)
    201200            throw new IllegalStateException();
    202         byte[] mod = new byte[LENGTH];
    203         for (int i = 0; i < LENGTH; i++) {
    204             mod[i] = (byte)(modVal.charAt(i) & 0xFF);
    205         }
     201        byte[] mod = DataHelper.getASCII(modVal);
    206202        return getKey(origKey, mod);
    207203    }
Note: See TracChangeset for help on using the changeset viewer.