randx

package
v0.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 2 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERRTYPENOTSUPPORTTED = errors.New("ekit:不支持的类型")

Functions

func RandCode

func RandCode(length int, typ TYPE) (string, error)

RandCode 根据传入的长度和类型生成随机字符串,这个方法目前可以生成数字、字母、数字+字母的随机字符串

Types

type TYPE

type TYPE int
const (
	TYPE_DEFAULT TYPE = 0 //默认类型
	TYPE_DIGIT   TYPE = 1 //数字//
	TYPE_LETTER  TYPE = 2 //小写字母
	TYPE_CAPITAL TYPE = 3 //大写字母
	TYPE_MIXED   TYPE = 4 //数字+字母混合
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL