knot

package
v0.0.0-...-be83087 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package knot implements the knot hash function (AoC 2017 days 10, 14).

Index

Constants

View Source
const N = 256

N is the standard list length for knot hashes.

View Source
const Rounds = 64

Rounds is the standard number of rounds for a knot hash.

View Source
const Size = 16

Size is the number of bytes in a knot hash with the standard parameters.

Variables

This section is empty.

Functions

func Hash

func Hash(N, rounds int, input string) []byte

Hash applies the knot hash function to the input string.

func List

func List(N int) []byte

List generates the initial knot hash state list, of the given size.

func Round

func Round(pos, skip int, list []byte, lengths []byte) (newPos, newSkip int)

Round applies a single knot hash Round to the given list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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