Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Data Generator #2

Open
barretlee opened this issue May 24, 2016 · 0 comments
Open

Data Generator #2

barretlee opened this issue May 24, 2016 · 0 comments

Comments

@barretlee
Copy link
Owner

barretlee commented May 24, 2016

数据生成器:./generator/index.js

提供了 7 个函数:

  • getRandomNumber,生成一个随机数
  • getRandomString,生成一个随机字符串
  • getRandomNumbers,生成一个随机数组
  • getDescRandomNumbers,同上,倒序
  • getEscRandomNumbers,同上,顺序
  • getRandomStrings,生成一串随机字符串
  • noRepeat,字符串/数组去重

传参也具备鲁棒性,比如 getRandomNumbers

  • getRandomNumbers();
  • getRandomNumbers(amount);
  • getRandomNumbers(min, max);
  • getRandomNumbers(amount, min, max);

默认长度为 20,随机数区间为 [0, 1E5],随机字符串区间为 a-zA-Z0-9_

后续会根据需要补充更多随机函数。

barretlee pushed a commit that referenced this issue Aug 24, 2016
Merge pull request #17 from StevenYuysy/master
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant