util

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0 modules, 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

Overview

Package util provides general-purpose utility functions.

It includes helper functions for hashing (MD5, SHA256), type conversion, slice operations, string manipulation, and execution path resolution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BcryptCheck

func BcryptCheck(password, hash string) bool

BcryptCheck 对比明文密码和数据库的哈希值

func BcryptHash

func BcryptHash(password string) string

BcryptHash 使用 bcrypt 对密码进行加密

func GetExecPath

func GetExecPath() (workDir string)

func MD5V

func MD5V(str []byte, b ...byte) string

func ParseDuration

func ParseDuration(d string) (time.Duration, error)

func RandString

func RandString(n int) string

func SHA256

func SHA256(input string) string

func SliceColumn

func SliceColumn[T any](items []T, separator string, jsonPath ...string) (map[string][]T, error)

func SlicesDistinct

func SlicesDistinct[T comparable](slice []T) []T

func TypePtr

func TypePtr[T any](v T) *T

Types

This section is empty.

Jump to

Keyboard shortcuts

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