MCPcopy Create free account
hub / github.com/crewjam/saml / newShortLink

Function newShortLink

example/service.go:77–83  ·  view source on GitHub ↗

newShortLink returns a random, URL-safe short link name.

()

Source from the content-addressed store, hash-verified

75
76// newShortLink returns a random, URL-safe short link name.
77func newShortLink() (string, error) {
78 randomness := make([]byte, 8)
79 if _, err := rand.Read(randomness); err != nil {
80 return "", err
81 }
82 return base64.RawURLEncoding.EncodeToString(randomness), nil
83}
84
85// CreateLink handles requests to create links. The target is the form value
86// "t", for example:

Callers 1

CreateLinkFunction · 0.85

Calls 1

ReadMethod · 0.45

Tested by

no test coverage detected