key

package
v0.0.0-...-157c9c8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultLength = 32

DefaultLength is the length that will be generated if no length is given to New

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key []byte

Key wraps a slice of bytes to help with generating and encoding.

func New

func New(ln int) Key

New creates a key using crypto/rand of the specified length. If the length is 0 then the default length is used.

func String

func String(s string) (Key, error)

String creates a key from a base64 URLEncoded string.

func (Key) Code

func (k Key) Code() string

Code converts the key to a string of Go code.

func (Key) String

func (k Key) String() string

String fulfills stringer and encodes the key using base64 URLEncoding.

Jump to

Keyboard shortcuts

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