Giter VIP home page Giter VIP logo

goregen's Introduction

goregen's People

Contributors

zach-klippenstein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

goregen's Issues

Generated strings are not random.

generator.Generate() returns the same string when run multiple times. Is this the expected behaviour?

package main

import (
        "math/rand"
        "fmt"
        regen "github.com/zach-klippenstein/goregen"
)

func main() {
        pattern := `^[a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,4}$`
        generator, _ := regen.NewGenerator(pattern, &regen.GeneratorArgs{
                RngSource: rand.NewSource(0),
        })

//      for i := 0; i < 10; i++ {
                fmt.Printf("email is %s\n", generator.Generate())
//      }
}

Fork Announcement

Hey,

First of all, I want to appreciate the author of this project. This library is super useful for testing. Sadly, the repo is abandoned, so I had to fork it to drop unnecessary dependencies.

My fork is here: https://github.com/AnatolyRugalev/goregen. Changelog:

  • added go mod support
  • dropped convey and gxui dependencies
  • tagged it with v0.1.0

Cheers.

results are not distributed randomly across domain represented by regex length

consider regex 0{1,10}, https://goregen-demo.herokuapp.com/?Regex=0%7B1%2C10%7D&Count=10

after performing this query 10 times it appears that the results are skewed towards the lower lengths, with a majority of the results being 0 and 00. wondering if you have any insights into this or its just my imagination? perhaps it is related to how the value is generated in the case of this regex?

in contrast, a regex like this https://goregen-demo.herokuapp.com/?Regex=0%7C%5B1-9%5D&Count=10 appears to consistently distribute randomly across the domain.

dependency on gxui

There is a dependency on (unmaintained) gxui, just to get math.Max from gxui in tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.