Ejemplo n.º 1
0
        public RandomString(RndType type, int length)
        {
            Random random = new Random();
            string chars  = this.GetChars(type);

            this.Value = new string(Enumerable.Repeat(chars, length).Select(s => s[random.Next(s.Length)]).ToArray());
        }
Ejemplo n.º 2
0
        private string GetChars(RndType type)
        {
            switch (type)
            {
            case RndType.UPPER:
                return(UPPER);

            case RndType.LOWER:
                return(LOWER);

            case RndType.ADDRESS:
                return(ADDRESS);

            default:
                return(DIGITS);
            }
        }
Ejemplo n.º 3
0
 public RndByte(RndType rdtype)
 {
     this.rdtype = rdtype;
 }
Ejemplo n.º 4
0
 public Xavier(RndType rnd_type = RndType.Uniform, FactorType factor_type = FactorType.Avg, float magnitude = 3)
 {
     this._rnd_type    = rnd_type;
     this._factor_type = factor_type;
     this._magnitude   = magnitude;
 }
Ejemplo n.º 5
0
 public RndByte(RndType rdtype)
 {
     this.rdtype = rdtype;
 }