util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package util is a CLI tool for generating test exposure key data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeKey

func DecodeKey(b64key string) []byte

DecodeKey decodes base64 string to []byte.

func GenerateExposureKeys

func GenerateExposureKeys(numKeys, tr int, randomInterval bool) []v1.ExposureKey

GenerateExposureKeys creates the given number of exposure keys.

func GenerateKey

func GenerateKey() (string, error)

GenerateKey generates a key.

func RandomArrValue

func RandomArrValue(arr []string) (string, error)

RandomArrValue chooses a random element from the array.

func RandomBytes

func RandomBytes(arrLen int) ([]byte, error)

RandomBytes generates a random byte sequence.

func RandomExposureKey

func RandomExposureKey(intervalNumber int32, intervalCount int32, transmissionRisk int) (v1.ExposureKey, error)

RandomExposureKey creates a random exposure key.

func RandomInt

func RandomInt(maxValue int) (int, error)

RandomInt produces a random integer up to but not including maxValue.

func RandomIntWithMin

func RandomIntWithMin(min, max int) (int, error)

RandomIntWithMin is inclusive, [min:max].

func RandomIntervalCount

func RandomIntervalCount() (int32, error)

RandomIntervalCount produces a random interval.

func RandomReportType

func RandomReportType() (string, error)

func RandomRevisedReportType

func RandomRevisedReportType() (string, error)

func RandomTransmissionRisk

func RandomTransmissionRisk() (int, error)

RandomTransmissionRisk produces a random transmission risk score.

func ToBase64

func ToBase64(key []byte) string

ToBase64 encodes bytes array to base64.

Types

This section is empty.

Jump to

Keyboard shortcuts

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