Assets/Scripts/BIP39/Utilities.cs
/// <summary>
/// Converts a Uint32 into a Byte Array in Big Endian
/// </summary>
/// <param name="val">Uint32 to convert</param>
/// <param name="@out">Byte array that will contain the result of the conversion</param>
/// <param name="offset">Offset in byte array to start placing output</param>
Converts a Uint32 into a Byte Array in Big Endian
Converts a Uint32 into a Byte Array in Big Endian
public static void Uint32ToByteArrayBe(uint val, byte[] @out, int offset)
        {
            @out[offset + 0] = (byte)(val >> 24);
            @out[offset + 1] = (byte)(val >> 16);
            @out[offset + 2] = (byte)(val >> 8);
            @out[offset + 3] = (byte)(val >> 0);
        }
public static void Uint32ToByteArrayBe ( uint val , byte [ ] @out , int offset ) { @out [ offset + 0 ] = ( byte ) ( val >> 24 ) ; @out [ offset + 1 ] = ( byte ) ( val >> 16 ) ; @out [ offset + 2 ] = ( byte ) ( val >> 8 ) ; @out [ offset + 3 ] = ( byte ) ( val >> 0 ) ; }
Converts a Uint32 into a Byte Array in Big Endian
Converts a Uint32 into a Byte Array in Big Endian
val
uint
Uint32 to convert
Uint32 to convert
@out
byte[]
Byte array that will contain the result of the conversion
Byte array that will contain the result of the conversion
offset
int
Offset in byte array to start placing output
Offset in byte array to start placing output