generators

package
v0.0.1-Beta01 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package generators - NekoBlog backend server generator utils This file is for salt generator. Copyright (c) [2024], Author(s): - WhitePaper233<[email protected]>

Package generator - NekoBlog backend server data generators This file is for token generator. Copyright (c) [2024], Author(s): - WhitePaper233<[email protected]>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateSalt

func GenerateSalt(length int) (string, error)

GenerateSalt 生成指定长度的盐。

参数:

  • length:盐的长度

返回值:

  • string:生成的盐。
  • error:如果在生成盐的过程中发生错误,则返回相应的错误信息,否则返回nil。

func GenerateToken

func GenerateToken(uid uint64, username string) (string, *types.BearerTokenClaims, error)

GenerateToken 生成一个新的令牌。

参数:

  • uid:用户ID
  • username:用户名

返回值:

  • string:新的令牌。
  • error:如果在生成过程中发生错误,则返回相应的错误信息,否则返回nil。

Types

This section is empty.

Jump to

Keyboard shortcuts

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