Package org.magmacollective.libsss
Class Shares
- java.lang.Object
-
- org.magmacollective.libsss.Shares
-
public class Shares extends java.lang.ObjectEncoding methods for shares
-
-
Constructor Summary
Constructors Constructor Description Shares()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]concat(java.util.List<byte[]> shares)Concatenate a list of shares into a 1-dimensional array.static byte[]getKeyshare(byte[] shares, int i)From array of keyshares encoded in a 1-dimensional array, get the i'th keyshare.static byte[]getShare(byte[] shares, int i)From array of shares encoded in a 1-dimensional array, get the i'th share.static java.lang.StringtoHexString(byte[] share)Get a hexadecimal string representation of the specified share.
-
-
-
Method Detail
-
getShare
public static byte[] getShare(byte[] shares, int i)From array of shares encoded in a 1-dimensional array, get the i'th share.- Parameters:
shares- the 1-dimensional arrayi- the index of the share to get- Returns:
- the share extracted from the array.
-
getKeyshare
public static byte[] getKeyshare(byte[] shares, int i)From array of keyshares encoded in a 1-dimensional array, get the i'th keyshare.- Parameters:
shares- the 1-dimensional arrayi- the index of the keyshare to get- Returns:
- the keyshare extracted from the array.
-
concat
public static byte[] concat(java.util.List<byte[]> shares)
Concatenate a list of shares into a 1-dimensional array.- Parameters:
shares- the list of shares to combine- Returns:
- an array containing the data of all shares.
-
toHexString
public static java.lang.String toHexString(byte[] share)
Get a hexadecimal string representation of the specified share.- Parameters:
share- the share to convert to a string- Returns:
- a string that displays raw data bytes as human-readable hexadecimal values.
-
-