InvVect.deserialize constructor
Deserialize from bytes
Implementation
factory InvVect.deserialize(Uint8List data, int offset) {
if (data.length < offset + 36) {
throw ArgumentError('Invalid data length for InvVect');
}
// Read type (4 bytes, little endian)
final type = data[offset] |
(data[offset + 1] << 8) |
(data[offset + 2] << 16) |
(data[offset + 3] << 24);
// Read hash (32 bytes)
final hashBytes = data.sublist(offset + 4, offset + 36);
final hash = Hash.fromBytes(hashBytes);
return InvVect(type: type, hash: hash);
}