MCPcopy
hub / github.com/tailscale/tailscale / nkFromHex

Function nkFromHex

wgengine/userspace_test.go:475–484  ·  view source on GitHub ↗
(hex string)

Source from the content-addressed store, hash-verified

473}
474
475func nkFromHex(hex string) key.NodePublic {
476 if len(hex) != 64 {
477 panic(fmt.Sprintf("%q is len %d; want 64", hex, len(hex)))
478 }
479 k, err := key.ParseNodePublicUntyped(mem.S(hex[:64]))
480 if err != nil {
481 panic(fmt.Sprintf("%q is not hex: %v", hex, err))
482 }
483 return k
484}
485
486// an experiment to see if genLocalAddrFunc was worth it. As of Go
487// 1.16, it still very much is. (30-40x faster)

Calls 1

ParseNodePublicUntypedFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…