Documentation ¶
Index ¶
- func HiddenStr(origin string, opts ...hiddenStrOption) string
- func HiddenStrHead(origin string, length int, opts ...hiddenStrOption) string
- func HiddenStrLength(length uint) hiddenStrOption
- func HiddenStrStart(start uint) hiddenStrOption
- func HiddenStrSymbol(symbol string) hiddenStrOption
- func HiddenStrTail(origin string, length int, opts ...hiddenStrOption) string
- func RandomOptionLength(length uint) randomOption
- func RandomOptionLetter() randomOption
- func RandomOptionLower() randomOption
- func RandomOptionNumber() randomOption
- func RandomOptionUpper() randomOption
- type RandomResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HiddenStrHead ¶
HiddenStrHead 从头部开始替换 Example: ReplaceStrTail("13800138000", 4) Out: ****0138000
func HiddenStrLength ¶
func HiddenStrLength(length uint) hiddenStrOption
HiddenStrLength 设置替换的长度, 默认是 4
func HiddenStrStart ¶
func HiddenStrStart(start uint) hiddenStrOption
HiddenStrStart 设置替换的开始位置,默认是 3
func HiddenStrSymbol ¶
func HiddenStrSymbol(symbol string) hiddenStrOption
HiddenStrSymbol 设置隐藏时的替换内容, 默认是 *
func HiddenStrTail ¶
HiddenStrTail 尾部开始隐藏 Example: HiddenStrTail("13800138000", 4) Out: 1380013****
func RandomOptionLength ¶
func RandomOptionLength(length uint) randomOption
RandomOptionLength 设置随机字符串长度
Types ¶
type RandomResult ¶
type RandomResult []byte
随机字符串返回类型
func (RandomResult) Int ¶
func (b RandomResult) Int() int
ToInt 转成 int 类型, 不保证一定成功,要保证 seed 必须是纯数字,否则此处转换失败就是 0
func (RandomResult) String ¶
func (b RandomResult) String() string
Click to show internal directories.
Click to hide internal directories.