ConnectionId.fromUint8List constructor

ConnectionId.fromUint8List(
  1. Uint8List _bytes
)

Creates a ConnectionId from a Uint8List.

This is a more efficient constructor if you already have a Uint8List. Throws an ArgumentError if the length of bytes is not within the valid range minCidLength, maxCidLength.

Implementation

ConnectionId.fromUint8List(this._bytes) {
  if (_bytes.length < minCidLength || _bytes.length > maxCidLength) {
    throw ArgumentError(
      'ConnectionId must be between $minCidLength and $maxCidLength bytes long, got ${_bytes.length}');
  }
}