ecodeclub / ekit

支持泛型的工具库
https://doc.meoying.com/
Apache License 2.0
383 stars 164 forks source link

重构: randx.RandCode 代码 #241

Closed dxyinme closed 10 months ago

dxyinme commented 10 months ago
  1. 支持字符类型自由组合
  2. 增加对特殊字符的支持
  3. 增加函数RandStrByCharset,可以自定义字符集
  4. 增加对length小于0的异常处理
  5. 增加benchmark
codecov[bot] commented 10 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (eba89e1) 95.91% compared to head (4b42722) 95.79%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #241 +/- ## ========================================== - Coverage 95.91% 95.79% -0.13% ========================================== Files 66 66 Lines 3404 3424 +20 ========================================== + Hits 3265 3280 +15 - Misses 108 110 +2 - Partials 31 34 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dxyinme commented 10 months ago

我有一个小问题,就是有没有必要同时暴露 RandCode 和 RandStrCahrset 两个方法?

比如说,我不暴露 RandCode,我直接暴露 RandStrCharset,那么我直接用 RandStrCharset 会有什么问题吗?

不会有什么问题,RandCode的存在只是给RandStrByCharset做了一个封装,个人感觉还是可以保留的,为了给使用者带来方便,他们可以直接使用RandCode,而不需要自己拼凑字符集