mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-06-08 15:47:47 +00:00
Simplify the toBytes helper function a bit
This commit is contained in:
parent
ba9d1f7cb6
commit
1f6bceddb7
1 changed files with 1 additions and 3 deletions
|
@ -118,8 +118,6 @@ public class CryptoUtils {
|
||||||
private static byte[] toBytes(char[] chars) {
|
private static byte[] toBytes(char[] chars) {
|
||||||
CharBuffer charBuf = CharBuffer.wrap(chars);
|
CharBuffer charBuf = CharBuffer.wrap(chars);
|
||||||
ByteBuffer byteBuf = Charset.forName("UTF-8").encode(charBuf);
|
ByteBuffer byteBuf = Charset.forName("UTF-8").encode(charBuf);
|
||||||
byte[] bytes = Arrays.copyOfRange(byteBuf.array(), 0, byteBuf.limit());
|
return byteBuf.array();
|
||||||
zero(byteBuf.array());
|
|
||||||
return bytes;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue