Assets/Scripts/BIP39/Utilities.cs
/// <summary>
/// Convert a ulong to byte stream little endian
/// </summary>
/// <param name="val">ulong for conversion</param>
/// <param name="stream">byte stream of ulong in little endian order</param>
Convert a ulong to byte stream little endian
Convert a ulong to byte stream little endian
public static void Uint64ToByteStreamLe(ulong val, Stream stream)
        {
            var bytes = BitConverter.GetBytes(val);
            if (!BitConverter.IsLittleEndian)
            {
                Array.Reverse(bytes);
            }
            stream.Write(bytes, 0, bytes.Length);
        }
public static void Uint64ToByteStreamLe ( ulong val , Stream stream ) { var bytes = BitConverter . GetBytes ( val ) ; if ( ! BitConverter . IsLittleEndian ) { Array . Reverse ( bytes ) ; } stream . Write ( bytes , 0 , bytes . Length ) ; }
Convert a ulong to byte stream little endian
Convert a ulong to byte stream little endian
val
ulong
ulong for conversion
ulong for conversion
stream
Stream
byte stream of ulong in little endian order
byte stream of ulong in little endian order