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 ¶
GenerateSalt 生成指定长度的盐。
参数:
- length:盐的长度
返回值:
- string:生成的盐。
- error:如果在生成盐的过程中发生错误,则返回相应的错误信息,否则返回nil。
func GenerateToken ¶
GenerateToken 生成一个新的令牌。
参数:
- uid:用户ID
- username:用户名
返回值:
- string:新的令牌。
- error:如果在生成过程中发生错误,则返回相应的错误信息,否则返回nil。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.