Assets/Scripts/BIP39/Utilities.cs
// <summary>
/// Turns a byte array into a Hex encoded string
/// </summary>
/// <param name="bytes">The bytes to encode to hex</param>
/// <returns>The hex encoded representation of the bytes</returns>
Turns a byte array into a Hex encoded string
Turns a byte array into a Hex encoded string
public static string BytesToHexString(byte[] bytes, bool upperCase = false)
        {
            if (upperCase)
            {
                return string.Concat(bytes.Select(byteb => byteb.ToString("X2")).ToArray());
            }
            else
            {
                return string.Concat(bytes.Select(byteb => byteb.ToString("x2")).ToArray());
            }
        }
public static string BytesToHexString ( byte [ ] bytes , bool upperCase = false ) { if ( upperCase ) { return string . Concat ( bytes . Select ( byteb => byteb . ToString ( " " ) ) . ToArray ( ) ) ; } else { return string . Concat ( bytes . Select ( byteb => byteb . ToString ( " " ) ) . ToArray ( ) ) ; } }
Turns a byte array into a Hex encoded string
Turns a byte array into a Hex encoded string
The hex encoded representation of the bytes
The hex encoded representation of the bytes
bytes
byte[]
The bytes to encode to hex
The bytes to encode to hex
upperCase
bool