pub fn write_mpint(&mut self, val: &[u8]) {
        let mut bytes = val.to_vec();

        // If most significant bit is set then prepend a zero byte to
        // avoid interpretation as a negative number.
        if val.get(0).unwrap_or(&0) & 0x80 != 0 {
            bytes.insert(0, 0);
        }

        self.write_bytes(&bytes);
    }
/// Writes an `mpint` value to the underlying byte sequence.
/// If the MSB bit of the first byte is set then the number is
/// negative, otherwise it is positive.
/// Positive numbers must be preceeded by a leading zero byte according to RFC 4251, section 5.
///
/// # Example
/// ```rust
/// # use sshcerts::ssh::Writer;
/// let mut writer = Writer::new();
/// writer.write_mpint(&[1, 0, 1]);
/// let bytes = writer.into_bytes();
/// assert_eq!(bytes, [0, 0, 0, 3, 1, 0, 1]);
/// ```
Writes an `mpint` value to the underlying byte sequence.
If the MSB bit of the first byte is set then the number is
negative, otherwise it is positive.
Positive numbers must be preceeded by a leading zero byte according to RFC 4251, section 5.
Writes an ` mpint ` value to the underlying byte sequence . If the MSB bit of the first byte is set then the number is negative otherwise it is positive . Positive numbers must be preceeded by a leading zero byte according to RFC 4251 section 5 .
pub fn write_mpint(&mut self, val: &[u8]) {
        let mut bytes = val.to_vec();
        // If most significant bit is set then prepend a zero byte to
        // avoid interpretation as a negative number.
        if val.get(0).unwrap_or(&0) & 0x80 != 0 {
            bytes.insert(0, 0);
        }
        self.write_bytes(&bytes);
    }
pub fn write_mpint ( & mut self , val : & [ u8 ] ) { let mut bytes = val . to_vec ( ) ; // If most significant bit is set then prepend a zero byte to // avoid interpretation as a negative number. if val . get ( 0 ) . unwrap_or ( & 0 ) & 0x80 != 0 { bytes . insert ( 0 , 0 ) ; } self . write_bytes ( & bytes ) ; }
Writes an `mpint` value to the underlying byte sequence.
Writes an ` mpint ` value to the underlying byte sequence .
&mut self
val
&[u8]
example
None
use sshcerts::ssh::writer;
None