1. sergworks
  2. TForge

Wiki

Clone wiki

TForge / Classes / TRandom / TRandom

type TRandom


Unit: tfRandoms


Instance Methods
GetRand Generates pseudorandom byte sequence
Burn Deletes confidential data from TRandom instance
Free Decrements reference count of TRandom instance

Remarks

  • TRandom instance is freed from memory when the reference count reaches zero.
  • there is no need to call TRandom.Free explicitly; the instance is freed automatically when it goes out of scope
  • TRandom.Free invokes TRandom.Burn when the instance is freed from memory

Example

var
  I, N: Integer;
  Rand: TRandom;

begin
  try
    for I:= 0 to 11 do begin
      Rand.GetRand(N, SizeOf(N));
      Writeln(IntToHex(N, 8));
    end;
  finally
    Rand.Burn;
  end;
end;

Updated