Documentation ¶
Index ¶
- func AddFloatStrings(a, b string) (string, error)
- func CalculateGasFee(gasLimitStr, gasPriceStr string) (gasFeeStr string, err error)
- func ConvertTimestampToFormat(timestamp int64) string
- func GweiToEther(gwei string) (string, error)
- func HttpDelete(url string, data []byte, header ...byte) ([]byte, error)
- func HttpGet(url string, header ...byte) ([]byte, error)
- func HttpPost(url string, data []byte, header ...byte) ([]byte, error)
- func HttpPut(url string, data []byte, header ...byte) ([]byte, error)
- func If(condition bool, trueValue, falseValue interface{}) interface{}
- func Int64ToBytes(n int64) []byte
- func IsMainCoin(currency string) bool
- func Md5(s string) string
- func Md5GenerateSaltedHash(password string, salt int64) string
- func MultiplyFloatStrings(a, b string) (string, error)
- func RFC3339ToNormalTime(rfc3339 string) string
- func ShiftBalance(balance, precision string) (string, error)
- func StringArrayToString(arr []string) string
- func ValidatePassword(password string) bool
- func WeiToEther(wei string) (string, error)
- type SnowflakeIDGenerator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddFloatStrings ¶
func CalculateGasFee ¶
CalculateGasFee 计算最终的GasFee
func ConvertTimestampToFormat ¶
ConvertTimestampToFormat 时间戳转换成日期格式
func GweiToEther ¶
GweiToEther GweiToEther 将 gwei 转换为 ether
func Int64ToBytes ¶
func IsMainCoin ¶
func Md5GenerateSaltedHash ¶
func MultiplyFloatStrings ¶
MultiplyFloatStrings 两个字符串类型的浮点数相乘
func RFC3339ToNormalTime ¶
RFC3339ToNormalTime RFC3339 日期格式标准化
func StringArrayToString ¶
将一个string类型的数组转换成string类型用逗号分割的字符串
func ValidatePassword ¶
Types ¶
type SnowflakeIDGenerator ¶
type SnowflakeIDGenerator struct {
// contains filtered or unexported fields
}
SnowflakeIDGenerator 结构体定义
func NewSnowflakeIDGenerator ¶
func NewSnowflakeIDGenerator(epoch, nodeID, sequenceBits, nodeIDBits int64) *SnowflakeIDGenerator
NewSnowflakeIDGenerator 创建一个新的SnowflakeIDGenerator
func (*SnowflakeIDGenerator) Generate ¶
func (gen *SnowflakeIDGenerator) Generate() int64
Generate 生成一个雪花ID
Click to show internal directories.
Click to hide internal directories.