MCPcopy
hub / github.com/nats-io/nats.go / wsMakeChallengeKey

Function wsMakeChallengeKey

ws.go:823–829  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

821}
822
823func wsMakeChallengeKey() (string, error) {
824 p := make([]byte, 16)
825 if _, err := io.ReadFull(rand.Reader, p); err != nil {
826 return "", err
827 }
828 return base64.StdEncoding.EncodeToString(p), nil
829}
830
831func wsAcceptKey(key string) string {
832 h := sha1.New()

Callers 1

wsInitHandshakeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected