encoding

package
v2.3.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func B64DecodeURL

func B64DecodeURL(hmackey []byte, encdig string, encURL string) (string, error)

B64DecodeURL ensures the url is properly verified via HMAC, and then unencodes the url, returning the url (if valid) and whether the HMAC was verified.

func B64EncodeURL

func B64EncodeURL(hmacKey []byte, oURL string) string

B64EncodeURL takes an HMAC key and a url, and returns url path partial consisitent of signature and encoded url.

func DecodeURL

func DecodeURL(hmackey []byte, encdig string, encURL string) (string, bool)

DecodeURL ensures the url is properly verified via HMAC, and then unencodes the url, returning the url (if valid) and whether the HMAC was verified. Tries either HexDecode or B64Decode, depending on the length of the encoded hmac.

func HexDecodeURL

func HexDecodeURL(hmackey []byte, hexdig string, hexURL string) (string, error)

HexDecodeURL ensures the url is properly verified via HMAC, and then unencodes the url, returning the url (if valid) and whether the HMAC was verified.

func HexEncodeURL

func HexEncodeURL(hmacKey []byte, oURL string) string

HexEncodeURL takes an HMAC key and a url, and returns url path partial consisitent of signature and encoded url.

Types

type DecoderFunc

type DecoderFunc func([]byte, string, string) (string, error)

DecoderFunc is a function type that defines a url decoder.

type EncoderFunc

type EncoderFunc func([]byte, string) string

EncoderFunc is a function type that defines a url encoder.

Jump to

Keyboard shortcuts

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