mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Add json output listIdentities command
This commit is contained in:
parent
70fc2381d3
commit
11c90fa032
5 changed files with 94 additions and 25 deletions
|
@ -45,11 +45,18 @@ public class Util {
|
|||
}
|
||||
|
||||
public static String formatSafetyNumber(String digits) {
|
||||
if (digits == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final var partCount = 12;
|
||||
var partSize = digits.length() / partCount;
|
||||
var f = new StringBuilder(digits.length() + partCount);
|
||||
for (var i = 0; i < partCount; i++) {
|
||||
f.append(digits, i * partSize, (i * partSize) + partSize).append(" ");
|
||||
f.append(digits, i * partSize, (i * partSize) + partSize);
|
||||
if (i != partCount - 1) {
|
||||
f.append(" ");
|
||||
}
|
||||
}
|
||||
return f.toString();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue