encodeRational method
Implementation
List<int> encodeRational() {
// Convert numerator and denominator to bytes
final numeratorBytes = BigintUtils.toBytes(numerator, length: 2);
final denominatorBytes = BigintUtils.toBytes(denominator, length: 2);
// Concatenate numerator and denominator bytes
final bytes = List<int>.from(numeratorBytes)..addAll(denominatorBytes);
// Specify the endianness when converting to List<int>
return bytes;
}