/// <summary>
/// Create an intermediate from a passphrase or intermediate code
/// </summary>
public Bip38Intermediate(string fromstring, Interpretation interpretation, int startingSequenceNumber = 0)
{
if (interpretation == Interpretation.IntermediateCode) {
createFromCode(fromstring);
} else {
_ownerentropy = new byte[8];
// Get 8 random bytes to use as salt
SecureRandom sr = new SecureRandom();
sr.NextBytes(_ownerentropy);
// set lot number between 100000 and 999999, and sequence number to 1
long x = (sr.NextLong () % 900000L + 100000L) * 4096L + (long)startingSequenceNumber;
for (int i=7; i>=4; i--) {
_ownerentropy[i] = (byte)(x & 0xFF);
x >>= 8;
}
createFromPassphrase(fromstring, _ownerentropy, true);
}
}