Documentation ¶
Index ¶
- func CalculateFileHash(file afero.File) ([]byte, error)
- func CalculateHash(data []byte) []byte
- func CheckAndMkdir(dirPath string) error
- func DecodeFromBytes(data []byte, result interface{}) error
- func EncodeToBytes(data interface{}) ([]byte, error)
- func FromBytes[T any](data []byte) (T, error)
- func MergeFieldsForSigning(fields ...interface{}) ([]byte, error)
- func SeparateHashFromData(combinedData []byte) ([]byte, []byte, error)
- func ToBytes[T any](data T) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeFromBytes ¶
DecodeFromBytes 使用 gob 解码将 []byte 转换为指定的数据结构
func EncodeToBytes ¶
EncodeToBytes 使用 gob 编码将任意数据转换为 []byte
func MergeFieldsForSigning ¶
MergeFieldsForSigning 接受任意数量和类型的字段,将它们序列化并合并为一个 []byte。
func SeparateHashFromData ¶
SeparateHashFromData 从数据中分离出SHA-256哈希值和原始数据
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.