mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 14:48:07 +01:00
Support for push preauth
This commit is contained in:
@@ -31,14 +31,18 @@ public class Hex {
|
||||
};
|
||||
|
||||
public static String toString(byte[] bytes) {
|
||||
return toString(bytes, 0, bytes.length);
|
||||
return toString(bytes, 0, bytes.length, false);
|
||||
}
|
||||
|
||||
public static String toString(byte[] bytes, int offset, int length) {
|
||||
public static String toStringCondensed(byte[] bytes) {
|
||||
return toString(bytes, 0, bytes.length, true);
|
||||
}
|
||||
|
||||
public static String toString(byte[] bytes, int offset, int length, boolean condensed) {
|
||||
StringBuffer buf = new StringBuffer();
|
||||
for (int i = 0; i < length; i++) {
|
||||
appendHexChar(buf, bytes[offset + i]);
|
||||
buf.append(' ');
|
||||
if (!condensed) buf.append(' ');
|
||||
}
|
||||
return buf.toString();
|
||||
}
|
||||
|
||||
@@ -170,6 +170,10 @@ public class Util {
|
||||
return Arrays.hashCode(objects);
|
||||
}
|
||||
|
||||
public static boolean isEquals(Object first, Object second) {
|
||||
return (first == null && second == null) || (first == second) || (first != null && first.equals(second));
|
||||
}
|
||||
|
||||
public static long todayInMillis() {
|
||||
return TimeUnit.DAYS.toMillis(TimeUnit.MILLISECONDS.toDays(System.currentTimeMillis()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user