]>
nmode's Git Repositories - signal-cli/blob - src/main/java/org/asamk/signal/manager/GroupLinkPassword.java
1 package org
.asamk
.signal
.manager
;
3 import java
.util
.Arrays
;
5 public final class GroupLinkPassword
{
7 private static final int SIZE
= 16;
9 private final byte[] bytes
;
11 public static GroupLinkPassword
createNew() {
12 return new GroupLinkPassword(KeyUtils
.getSecretBytes(SIZE
));
15 public static GroupLinkPassword
fromBytes(byte[] bytes
) {
16 return new GroupLinkPassword(bytes
);
19 private GroupLinkPassword(byte[] bytes
) {
23 public byte[] serialize() {
28 public boolean equals(Object other
) {
29 if (!(other
instanceof GroupLinkPassword
)) {
33 return Arrays
.equals(bytes
, ((GroupLinkPassword
) other
).bytes
);
37 public int hashCode() {
38 return Arrays
.hashCode(bytes
);