Ulid.fromBytes constructor

Ulid.fromBytes(
  1. List<int> bytes
)

Creates a new instance form the provided bytes buffer.

Implementation

factory Ulid.fromBytes(List<int> bytes) {
  if (bytes.length != 16 || bytes.any((b) => b > 256 || b < 0)) {
    throw ArgumentError.value(bytes, 'bytes', 'Invalid input.');
  }
  return Ulid._(Uint8List.fromList(bytes));
}