mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Add added timestamp to Identities
This commit is contained in:
parent
f2c2597379
commit
55d485de88
3 changed files with 69 additions and 24 deletions
22
src/main/java/org/asamk/signal/Hex.java
Normal file
22
src/main/java/org/asamk/signal/Hex.java
Normal file
|
@ -0,0 +1,22 @@
|
|||
package org.asamk.signal;
|
||||
|
||||
public class Hex {
|
||||
|
||||
private final static char[] HEX_DIGITS = {
|
||||
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
|
||||
};
|
||||
|
||||
public static String toStringCondensed(byte[] bytes) {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
for (int i = 0; i < bytes.length; i++) {
|
||||
appendHexChar(buf, bytes[i]);
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
private static void appendHexChar(StringBuffer buf, int b) {
|
||||
buf.append(HEX_DIGITS[(b >> 4) & 0xf]);
|
||||
buf.append(HEX_DIGITS[b & 0xf]);
|
||||
buf.append(" ");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue