utils

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2020 License: MIT Imports: 16 Imported by: 1

README

go-cryptolib

一些常见加密算法封装

包括:

  • Hash - SHA1/SHA2/MD5/CSC32
  • 对称加密 - AES
  • 非对称加密 - RSA256/RSA512
  • 签名 - RSA-SHA1/RSA-SHA256/RSA-SHA512/ECC-ED25519

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomTimestampGen

func CustomTimestampGen() string

CustomTimestampGen CustomTimestampGen

func DeepCopy

func DeepCopy(dst, src interface{}) error

DeepCopy DeepCopy

func DeepCopyByJSON

func DeepCopyByJSON(dst, src interface{}) error

DeepCopyByJSON DeepCopyByJSON

func DefaultString

func DefaultString(value, defaultValue string) string

DefaultString DefaultString

func GetRandomNum

func GetRandomNum(l int) string

GetRandomNum GetRandomNum

func GetRandomSixDigital

func GetRandomSixDigital() string

GetRandomSixDigital GetRandomSixDigital

func GetRandomString

func GetRandomString(l int) string

GetRandomString GetRandomString

func IsDigitPresent

func IsDigitPresent(number, d int) bool

IsDigitPresent IsDigitPresent

func IsDigitPresentUint64

func IsDigitPresentUint64(number uint64, d uint64) bool

IsDigitPresentUint64 IsDigitPresentUint64

func OrderBizIDGen

func OrderBizIDGen() string

OrderBizIDGen BIZIDGen 201907301746-544-0298

func OrderOriIDRestore

func OrderOriIDRestore(bizid string) string

OrderOriIDRestore OrderOriIDRestore order-2019080812282674502

func OrderShortBizIDGen

func OrderShortBizIDGen() string

OrderShortBizIDGen BIZIDGen 1907301746-54-029

func OrderShortBizIDGenUint64

func OrderShortBizIDGenUint64() uint64

OrderShortBizIDGenUint64 OrderShortBizIDGenUint64

func ParseBytesToInt

func ParseBytesToInt(b []byte) int

ParseBytesToInt 字节转换成整形

func ParseBytesToInt32 added in v0.1.2

func ParseBytesToInt32(b []byte) int32

ParseBytesToInt32 字节转换成整形

func ParseBytesToInt64 added in v0.1.2

func ParseBytesToInt64(b []byte) int64

ParseBytesToInt64 字节转换成整形

func ParseBytesToUint added in v0.1.2

func ParseBytesToUint(b []byte) uint

ParseBytesToUint 字节转换成整形

func ParseBytesToUint32 added in v0.1.2

func ParseBytesToUint32(b []byte) uint32

ParseBytesToUint32 字节转换成整形

func ParseBytesToUint64 added in v0.1.2

func ParseBytesToUint64(b []byte) uint64

ParseBytesToUint64 字节转换成整形

func ParseInt32ToBytes added in v0.1.2

func ParseInt32ToBytes(num int32) []byte

ParseInt32ToBytes 整形转换成字节

func ParseInt32ToStr

func ParseInt32ToStr(value int32) string

ParseInt32ToStr ParseInt32ToStr

func ParseInt64ToBytes added in v0.1.2

func ParseInt64ToBytes(num int64) []byte

ParseInt64ToBytes 整形转换成字节

func ParseInt64ToStr

func ParseInt64ToStr(value int64) string

ParseInt64ToStr ParseInt64ToStr

func ParseIntToBytes

func ParseIntToBytes(num int) []byte

ParseIntToBytes 整形转换成字节

func ParseIntToStr added in v0.1.2

func ParseIntToStr(value int) string

ParseIntToStr ParseIntToStr

func ParseStrToInt

func ParseStrToInt(value string, defaultValue int) int

ParseStrToInt ParseInt

func ParseStrToInt32 added in v0.1.2

func ParseStrToInt32(value string, defaultValue int32) int32

ParseStrToInt32 ParseStrToInt32

func ParseStrToInt64

func ParseStrToInt64(value string, defaultValue int64) int64

ParseStrToInt64 ParseInt64

func ParseStrToUint

func ParseStrToUint(value string, defaultValue uint) uint

ParseStrToUint ParseUint

func ParseStrToUint32

func ParseStrToUint32(value string, defaultValue uint32) uint32

ParseStrToUint32 ParseUint

func ParseStrToUint64

func ParseStrToUint64(value string, defaultValue uint64) uint64

ParseStrToUint64 ParseUint64

func ParseTimeNano

func ParseTimeNano(value string, defaultValue time.Time) time.Time

ParseTimeNano ParseTimeNano

func ParseUint32ToBytes

func ParseUint32ToBytes(num uint32) []byte

ParseUint32ToBytes 整形转换成字节

func ParseUint32ToStr added in v0.1.2

func ParseUint32ToStr(value uint32) string

ParseUint32ToStr ParseUint32ToStr

func ParseUint64ToBytes

func ParseUint64ToBytes(num uint64) []byte

ParseUint64ToBytes 整形转换成字节

func ParseUint64ToStr

func ParseUint64ToStr(value uint64) string

ParseUint64ToStr ParseUint64ToStr

func ParseUintToBytes added in v0.1.2

func ParseUintToBytes(num uint) []byte

ParseUintToBytes 整形转换成字节

func ParseUintToStr added in v0.1.2

func ParseUintToStr(value uint) string

ParseUintToStr ParseUintToStr

func SettlementID

func SettlementID(id, modifier string) string

SettlementID 根据规则生成 UUID

func SplitPhone

func SplitPhone(phone string) (string, string, apperr.Error)

SplitPhone SplitPhone +8615618297195",

func UUIDFromString

func UUIDFromString(value string) (uuid.UUID, error)

UUIDFromString UUIDFromString

func UUIDGen

func UUIDGen() string

UUIDGen UUIDGen b9be9a09-7117-4bdb-9c6d-737269c86480

func UUIDString

func UUIDString(id uuid.UUID) string

UUIDString UUIDString

func UUIDStringGen

func UUIDStringGen() string

UUIDStringGen UUIDStringGen 5106b5e58ee44f74a5d49e779dcf7f57

func UUIDV1Gen

func UUIDV1Gen() string

UUIDV1Gen UUIDV1Gen b9be9a09-7117-4bdb-9c6d-737269c86480

func UUIDV4Gen

func UUIDV4Gen() string

UUIDV4Gen UUIDGen b9be9a09-7117-4bdb-9c6d-737269c86480

Types

This section is empty.

Directories

Path Synopsis
aes
rsa

Jump to

Keyboard shortcuts

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