gorcp

package module
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: GPL-2.0 Imports: 4 Imported by: 0

README

gorcp

Coverage

Implemention of RCP in go

Usage

// Config is used to create a checksum as well as validate a checksum
config := &RCPConfig{
  UseTimeComponent: true,
  SharedSecret:     "Shared Secret Key",
  TimeDelta:        5,
}

m := make(map[string]string)
m["key1"] = "value1"
m["key2"] = "value2"

// Get the checksum for a given dictionary
checksum := GetChecksum(&m, "TestSalt", config) 

// Validate a given checksum
if !ValidateChecksum(&m, checksum, "TestSalt", config) {
     fmt.Println("Checksum was incorrect")
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChecksum

func GetChecksum(m *map[string]interface{}, salt string, config *RCPConfig) (checksum string)

func ValidateChecksum

func ValidateChecksum(m *map[string]interface{}, checksum string, salt string, config *RCPConfig) (b bool)

Types

type RCPConfig

type RCPConfig struct {
	SharedSecret     string
	UseTimeComponent bool
	TimeDelta        int64
}

Jump to

Keyboard shortcuts

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