encodeFixedBytes function
Implementation
Uint8List encodeFixedBytes(Uint8List v, int length) {
if(v.length > 32) {
throw Exception("Can not encode fixed bytes of length longer than 32");
}
if(v.length != length) {
throw Exception("incompatible byte length");
}
var pad0s = 32 - v.length;
List<int> pads = [];
for(var i = 0; i < pad0s; i++) {
pads.add(0);
}
return Uint8List.fromList(v + pads);
}