toBytes static method
Masks every element of bytes to a single byte (0-255).
Implementation
static BuBytes toBytes(Iterable<int> bytes, {bool unmodifiable = false}) {
final masked = bytes.map((e) => e & BinaryOps.mask8).toList();
if (unmodifiable) {
return BuBytes.immutable(masked);
}
return BuBytes(masked);
}