Skip to content

Commit

Permalink
添加生成假手机号的方法
Browse files Browse the repository at this point in the history
  • Loading branch information
binarywang committed Oct 18, 2016
1 parent 71f962f commit 1f7fd2d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ public String generate() {
.leftPad("" + RandomUtils.nextInt(0, 99999999 + 1), 8, "0");
}

/**
* 生成假的手机号,以19开头
*/
public String generateFake() {
return "19" + StringUtils
.leftPad("" + RandomUtils.nextInt(0, 999999999 + 1), 9, "0");
}

private static String genMobilePre() {
return "" + MOBILE_PREFIX[RandomUtils.nextInt(0, MOBILE_PREFIX.length)];
}
Expand Down

0 comments on commit 1f7fd2d

Please sign in to comment.