Documentation
¶
Overview ¶
Package hashvalues is a simple wrapper for hmac data.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
Base64Decode decodes a cookie using base64.
func Base64Encode ¶
Base64Encode encodes a value using base64.
Types ¶
type HashValues ¶
HashValues struct
func New ¶
func New(hashkey []byte, hashfunc func() hash.Hash) *HashValues
New to new a HashValues.
Example ¶
var h = New(hashkey, hashfunc) h.Set("name", "Toomore") h.Set("age", "30") key, msg := h.Encode() fmt.Printf("Key:[%s] Msg:[%s]", key, msg)
Output: Key:[aTMzslluGEzE-uNMoLtBC2vN6aDYGc8fIXJFi_oXPG4=] Msg:[YWdlPTMwJm5hbWU9VG9vbW9yZQ==]
func (*HashValues) Decode ¶
func (h *HashValues) Decode(key, message []byte) error
Decode to decode a hmac key with message.
func (*HashValues) Encode ¶
func (h *HashValues) Encode() ([]byte, []byte)
Encode to encode all data.