crypto

package
v0.0.0-...-5452022 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(username string, isUser bool, secret string) (jwt_token string, err error)

create a jwt token using username or name, if token is a user set to `True` if agent `False`

func Hash

func Hash(input string) (out string)

func HashToNumber

func HashToNumber(input string) *big.Int

Types

type CustomClaims

type CustomClaims struct {
	jwt.RegisteredClaims
	Name        string `json:"name"`
	IsUserToken bool   `json:"is_user_token"`
}

jwt type

func VerifyToken

func VerifyToken(jwtToken, secret string) (claims *CustomClaims, err error)

verifies the token and returns the `CustomClaims` struct and error

Jump to

Keyboard shortcuts

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