util

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstLetter

func FirstLetter(s string) (string, error)

FirstLetter returns the uppercase first letter of a rune no changes should be made if there is no suitable code

func Iconv

func Iconv(s string, former transform.Transformer) ([]byte, error)

Iconv transform rune by former

e.g: `simplifiedchinese.GBK.NewEncoder()` and `simplifiedchinese.GBK.NewDecoder()`

func Int

func Int(rand io.Reader, min, max *big.Int) (n *big.Int, err error)

Int returns a uniform random value in [min, max). It panics if max <= min. Ref crypto/rand

func IsFile

func IsFile(path string) bool

IsFile returns true if given path exists as a file (i.e. not a directory).

func MtRand

func MtRand(min, max int64) (int64, error)

MtRand crypto rand a number

func Ord

func Ord(s string) int

Ord convert the first byte of a string to a value between 0 and 255

func OrdByte

func OrdByte(b byte) int

OrdByte convert byte to a value between 0 and 255

func OrdRune

func OrdRune(r rune) int

OrdRune convert rune to a value between 0 and 255

Types

This section is empty.

Jump to

Keyboard shortcuts

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