DeriveJunction.fromBytes constructor
Create a new DeriveJunction from a given byte encoded value.
Implementation
factory DeriveJunction.fromBytes(bool hard, Uint8List junctionId) {
final bytes = Uint8List(junctionIdLength);
if (junctionId.length > junctionIdLength) {
final digest = Blake2bDigest(digestSize: 32);
digest.update(junctionId, 0, junctionId.length);
digest.doFinal(bytes, 0);
} else {
bytes.setAll(0, junctionId);
}
return DeriveJunction(hard, bytes);
}