mcassoc

package
v0.0.0-...-527bd1f Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DATABLOCK_WIDTH  = 8
	DATABLOCK_HEIGHT = 8
)

Variables

View Source
var (
	ERR_SKIN_TOO_SMALL = errors.New(`skin must be at least 8x8`)
)
View Source
var (
	PRESENCE_PATTERN = []color.NRGBA{
		{0, 0, 0, 255},
		{30, 0, 0, 255},
		{0, 30, 0, 255},
		{0, 0, 30, 255},
		{30, 30, 0, 255},
		{0, 30, 30, 255},
		{30, 0, 30, 255},
		{30, 30, 30, 255},
	}
)

Functions

func CompareDatablocks

func CompareDatablocks(ours image.Image, theirs image.Image) bool

func Embed

func Embed(data string, key string, skin image.Image) (image.Image, error)

func GenerateDatablock

func GenerateDatablock(data string, key string) (image.Image, error)

func HasDatablock

func HasDatablock(theirs image.Image) bool

func Verify

func Verify(data string, key string, skin image.Image) (bool, error)

Types

type Associfier

type Associfier struct {
	// contains filtered or unexported fields
}

func NewAssocifier

func NewAssocifier(key string) Associfier

func (Associfier) Embed

func (a Associfier) Embed(data string, skin image.Image) (image.Image, error)

func (Associfier) Verify

func (a Associfier) Verify(data string, skin image.Image) (bool, error)

Jump to

Keyboard shortcuts

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