util

package
v0.0.0-...-887f819 Latest Latest
Warning

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

Go to latest
Published: May 4, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcPassword

func CalcPassword(scramble, sha1pwd []byte) []byte

CalcPassword is the algorithm convert hashed password to auth string. See: https://dev.mysql.com/doc/internals/en/secure-password-authentication.html SHA1( password ) XOR SHA1( "20-bytes random data from server" <concat> SHA1( SHA1( password ) ) )

func DecodePassword

func DecodePassword(pwd string) ([]byte, error)

DecodePassword converts hex string password to byte array.

func DelKeyWithPrefix

func DelKeyWithPrefix(rm kv.RetrieverMutator, prefix kv.Key) error

DelKeyWithPrefix deletes keys with prefix.

func EncodePassword

func EncodePassword(pwd string) string

EncodePassword converts plaintext password to hashed hex string.

func RowKeyPrefixFilter

func RowKeyPrefixFilter(rowKeyPrefix kv.Key) kv.FnKeyCmp

RowKeyPrefixFilter returns a function which checks whether currentKey has decoded rowKeyPrefix as prefix.

func ScanMetaWithPrefix

func ScanMetaWithPrefix(retriever kv.Retriever, prefix kv.Key, filter func(kv.Key, []byte) bool) error

ScanMetaWithPrefix scans metadata with the prefix.

func Sha1Hash

func Sha1Hash(bs []byte) []byte

Sha1Hash is an util function to calculate sha1 hash.

Types

This section is empty.

Directories

Path Synopsis
Package mock is just for test only.
Package mock is just for test only.

Jump to

Keyboard shortcuts

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