signature

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sign

func Sign(content string, secret string, algo Algo) ([]byte, error)

Sign signs the content with the provided signature.

func SignURL

func SignURL(content string, secret string, algo Algo, length uint8) string

SignURL returns the URL signature.

Types

type Algo

type Algo = string

Algo represent the algorithm of the signature.

const (
	// SHA1 algorithm.
	SHA1 Algo = "sha1"
	// SHA256 algorithm.
	SHA256 Algo = "sha256"
)

type Length

type Length = uint8

Length represents the length of the signature.

const (
	// Short signature length
	Short Length = 8
	// Long signature length
	Long Length = 32
)

Jump to

Keyboard shortcuts

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