Documentation
¶
Index ¶
- func B64DecodeURL(hmackey []byte, encdig string, encURL string) (string, error)
- func B64EncodeURL(hmacKey []byte, oURL string) string
- func DecodeURL(hmackey []byte, encdig string, encURL string) (string, bool)
- func HexDecodeURL(hmackey []byte, hexdig string, hexURL string) (string, error)
- func HexEncodeURL(hmacKey []byte, oURL string) string
- type DecoderFunc
- type EncoderFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func B64DecodeURL ¶
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 ¶
B64EncodeURL takes an HMAC key and a url, and returns url path partial consisitent of signature and encoded url.
func DecodeURL ¶
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 ¶
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 ¶
HexEncodeURL takes an HMAC key and a url, and returns url path partial consisitent of signature and encoded url.
Types ¶
type DecoderFunc ¶
DecoderFunc is a function type that defines a url decoder.
type EncoderFunc ¶
EncoderFunc is a function type that defines a url encoder.