Documentation
¶
Index ¶
- Constants
- func FastHash(data interface{}) string
- func GenerateKeys() (publicKey string, privateKey string, err error)
- func GenerateKeysBytes() ([]byte, []byte, error)
- func Hash(data interface{}) string
- func RawFastHash(data interface{}) []byte
- func RawHash(data interface{}) []byte
- func ReadKeys(reader io.Reader) (publicKey string, privateKey string, publicIp string, port string)
- func Sign(privateKey interface{}, hash interface{}) (string, error)
- func Verify(publicKey interface{}, signature string, hash string) (bool, error)
- type HashBytes
- type SignerVerifier
Constants ¶
View Source
const HASH_LENGTH = 32
Variables ¶
This section is empty.
Functions ¶
func FastHash ¶
func FastHash(data interface{}) string
FastHash - sha1 hash the given data and return the hash as hex string
func GenerateKeys ¶
GenerateKeys - Generate assymetric private/public keys
func GenerateKeysBytes ¶
GenerateKeysBytes - Generate assymetric private/public keys
func Hash ¶
func Hash(data interface{}) string
Hash - hash the given data and return the hash as hex string
func RawFastHash ¶
func RawFastHash(data interface{}) []byte
RawFastHash - Logic to sha1 hash the text and return the hash bytes
func RawHash ¶
func RawHash(data interface{}) []byte
RawHash - Logic to hash the text and return the hash bytes
func ReadKeys ¶
ReadKeys - reads a publicKey and a privateKey from a Reader. They are assumed to be in two separate lines one followed by the other
Types ¶
type HashBytes ¶
type HashBytes [HASH_LENGTH]byte
Click to show internal directories.
Click to hide internal directories.