| 1384 | } |
| 1385 | |
| 1386 | unsigned int Integer::MinEncodedSize(Signedness signedness) const |
| 1387 | { |
| 1388 | unsigned int outputLen = STDMAX(1U, ByteCount()); |
| 1389 | if (signedness == UNSIGNED) |
| 1390 | return outputLen; |
| 1391 | if (NotNegative() && (GetByte(outputLen-1) & 0x80)) |
| 1392 | outputLen++; |
| 1393 | if (IsNegative() && *this < -Power2(outputLen*8-1)) |
| 1394 | outputLen++; |
| 1395 | return outputLen; |
| 1396 | } |
| 1397 | |
| 1398 | unsigned int Integer::Encode(byte *output, unsigned int outputLen, Signedness signedness) const |
| 1399 | { |