hashvalues: github.com/toomore/hashvalues Index | Examples | Files

package hashvalues

import "github.com/toomore/hashvalues"

Package hashvalues is a simple wrapper for hmac data.



Package Files


func Base64Decode Uses

func Base64Decode(value []byte) ([]byte, error)

Base64Decode decodes a cookie using base64.

func Base64Encode Uses

func Base64Encode(value []byte) []byte

Base64Encode encodes a value using base64.

type HashValues Uses

type HashValues struct {
    Values url.Values
    // contains filtered or unexported fields

HashValues struct

func New Uses

func New(hashkey []byte, hashfunc func() hash.Hash) *HashValues

New to new a HashValues.


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)


Key:[aTMzslluGEzE-uNMoLtBC2vN6aDYGc8fIXJFi_oXPG4=] Msg:[YWdlPTMwJm5hbWU9VG9vbW9yZQ==]

func (*HashValues) Add Uses

func (h *HashValues) Add(key, value string)

Add to add a key-value.

func (*HashValues) Decode Uses

func (h *HashValues) Decode(key, message []byte) error

Decode to decode a hmac key with message.

func (*HashValues) Del Uses

func (h *HashValues) Del(key string)

Del to del a key.

func (*HashValues) Encode Uses

func (h *HashValues) Encode() ([]byte, []byte)

Encode to encode all data.

func (*HashValues) Get Uses

func (h *HashValues) Get(key string) string

Get to get a value of key.

func (*HashValues) Set Uses

func (h *HashValues) Set(key, value string)

Set to set a key-value.

Package hashvalues imports 6 packages (graph) and is imported by 1 packages. Updated 2016-07-19. Refresh now. Tools for package owners.