Skip to content

Instantly share code, notes, and snippets.

@lisa
Created November 5, 2018 22:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lisa/b13b7d0f54319e3f3b147d433044a3b5 to your computer and use it in GitHub Desktop.
Save lisa/b13b7d0f54319e3f3b147d433044a3b5 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"strings"
"github.com/lisa/adventofcode/2017/src/simpleknot"
)
func stringToChars(str string) []byte {
ret := make([]byte, len(str))
for i, char := range strings.Split(str, "") {
ret[i] = byte(char[0])
}
return ret
}
func main() {
s := simpleknot.New(stringToChars("foobar"))
fmt.Println(s.String())
fmt.Println(s.DenseHashToString())
// I can't do s. and get a list of exported stuff
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment