util

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2019 License: MIT Imports: 16 Imported by: 1

README

util

golang 常用工具包

Documentation

Overview

Package util go实用库 RSA的签名及验签 SHA256 With RSA

Package util go实用库 RSA的签名及验签 SHA256 With RSA

Package util go实用库 安全散列算法SHA常用函数

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ceil

func Ceil(v float64) float64

Ceil 进一法

func Date

func Date(s, layout string) (int64, error)

Date 获取日期字符串的当地Unix时间戳 layout s的时间格式

func Floor

func Floor(v float64) float64

Floor 舍弃法

func MD5

func MD5(s string) string

MD5 字符串md5加密

func ParseTimeByUUID

func ParseTimeByUUID(uuid string) (dateTime string, err error)

ParseTimeByUUID 根据uuid, 获取生成该uuid的时间

func RSA

func RSA(src, privateKey string) (s string, err error)

RSA RSA签名

func RSACheck

func RSACheck(src, sign, publicKey string) (ok bool, err error)

RSACheck RSA验签

func Random

func Random(min, max int64) int64

Random 随机生成指定范围的数

func RandomNumber

func RandomNumber() int64

RandomNumber 随机生成一个数

func RandomStr

func RandomStr(length int) string

RandomStr 随机指定长度的字符串,不含大写

func RandomString

func RandomString(length int) string

RandomString 生成随机字符串

func Round

func Round(v float64, decimals int) float64

Round 四舍五入 decimals 精确到几位小数

func SHA256

func SHA256(s []byte) (r []byte, err error)

SHA256 加密

func TimeToSring

func TimeToSring(t time.Time, format string) string

TimeToSring 格式化time.Time输出日期字符串 MM - month - 01 M - month - 1, single bit DD - day - 02 D - day 2 YYYY - year - 2006 YY - year - 06 HH - 24 hours - 03 H - 24 hours - 3 hh - 12 hours - 03 h - 12 hours - 3 mm - minute - 04 m - minute - 4 ss - second - 05 s - second = 5

func UUID

func UUID() (uuid string, err error)

UUID 获取uuid

Types

This section is empty.

Directories

Path Synopsis
Package snowflake provides a very simple Twitter snowflake generator and parser.
Package snowflake provides a very simple Twitter snowflake generator and parser.

Jump to

Keyboard shortcuts

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