Changeset 185


Ignore:
Timestamp:
3/10/2008 9:04:46 AM (6 years ago)
Author:
lowjoel
Message:

Added the GUID field to the PRNG class since it too is plugin based.

Location:
branches/eraser6
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/DefaultPlugins/ISAAC.cs

    r176 r185  
    1515        { 
    1616            get { return "ISAAC CSPRNG"; } 
     17        } 
     18 
     19        public override Guid GUID 
     20        { 
     21            get { return new Guid("{CB7DE02E-8067-4270-B115-70AB49F23BB7}"); } 
    1722        } 
    1823 
  • branches/eraser6/DefaultPlugins/RNGCrypto.cs

    r176 r185  
    1515        } 
    1616 
     17        public override Guid GUID 
     18        { 
     19            get { return new Guid("{6BF35B8E-F37F-476e-B6B2-9994A92C3B0C}"); } 
     20        } 
     21 
    1722        public override void NextBytes(byte[] buffer) 
    1823        { 
  • branches/eraser6/Manager/PRNG.cs

    r181 r185  
    2828            get; 
    2929        } 
     30 
     31        /// <summary> 
     32        /// The GUID for this PRNG. 
     33        /// </summary> 
     34        public abstract Guid GUID 
     35        { 
     36            get; 
     37        } 
    3038    } 
    3139 
     
    3947        /// </summary> 
    4048        /// <returns>A mutable list, with an instance of each PRNG.</returns> 
    41         public static List<PRNG> GetGenerators() 
     49        public static Dictionary<Guid, PRNG> GetAll() 
    4250        { 
    4351            lock (Globals.PRNGManager.prngs) 
    44                 return Globals.PRNGManager.prngs.GetRange(0, 
    45                     Globals.PRNGManager.prngs.Count); 
     52                return Globals.PRNGManager.prngs; 
    4653        } 
    4754 
     
    5057        /// </summary> 
    5158        /// <param name="method"></param> 
    52         public static void Register(PRNG method) 
     59        public static void Register(PRNG prng) 
    5360        { 
    5461            lock (Globals.PRNGManager.prngs) 
    55                 Globals.PRNGManager.prngs.Add(method); 
     62                Globals.PRNGManager.prngs.Add(prng.GUID, prng); 
    5663        } 
    5764 
     
    5966        /// The list of currently registered erasure methods. 
    6067        /// </summary> 
    61         private List<PRNG> prngs = new List<PRNG>(); 
     68        private Dictionary<Guid, PRNG> prngs = new Dictionary<Guid, PRNG>(); 
    6269    } 
    6370} 
Note: See TracChangeset for help on using the changeset viewer.