Assets/Scripts/BIP39/Utilities.cs
/// <summary>
/// Converts a Uint32 into a Stream of Bytes in Little Endian
/// </summary>
/// <param name="val">Uint32 to make stream</param>
/// <param name="stream">Uint32 outout as byte stream little endian</param>
Converts a Uint32 into a Stream of Bytes in Little Endian
Converts a Uint32 into a Stream of Bytes in Little Endian
public static void Uint32ToByteStreamLe(uint val, Stream stream)
        {
            stream.Write((new byte[] { (byte)(val >> 0) }), 0, (new byte[] { (byte)(val >> 0) }).Length);
            stream.Write((new byte[] { (byte)(val >> 8) }), 0, (new byte[] { (byte)(val >> 8) }).Length);
            stream.Write((new byte[] { (byte)(val >> 16) }), 0, (new byte[] { (byte)(val >> 16) }).Length);
            stream.Write((new byte[] { (byte)(val >> 24) }), 0, (new byte[] { (byte)(val >> 24) }).Length);
        }
public static void Uint32ToByteStreamLe ( uint val , Stream stream ) { stream . Write ( ( new byte [ ] { ( byte ) ( val >> 0 ) } ) , 0 , ( new byte [ ] { ( byte ) ( val >> 0 ) } ) . Length ) ; stream . Write ( ( new byte [ ] { ( byte ) ( val >> 8 ) } ) , 0 , ( new byte [ ] { ( byte ) ( val >> 8 ) } ) . Length ) ; stream . Write ( ( new byte [ ] { ( byte ) ( val >> 16 ) } ) , 0 , ( new byte [ ] { ( byte ) ( val >> 16 ) } ) . Length ) ; stream . Write ( ( new byte [ ] { ( byte ) ( val >> 24 ) } ) , 0 , ( new byte [ ] { ( byte ) ( val >> 24 ) } ) . Length ) ; }
Converts a Uint32 into a Stream of Bytes in Little Endian
Converts a Uint32 into a Stream of Bytes in Little Endian
val
uint
Uint32 to make stream
Uint32 to make stream
stream
Stream
Uint32 outout as byte stream little endian
Uint32 outout as byte stream little endian