generator

package
v0.0.0-...-8ab94dc Latest Latest
Warning

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

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

Documentation

Overview

Package generator - NekoBlog backend server generator utils Copyright (c) [2024], Author(s): - WhitePaper233<baizhiwp@gmail.com>

Package generator - NekoBlog backend server data generators Copyright (c) [2024], Author(s): - WhitePaper233<baizhiwp@gmail.com>

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, 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