MCPcopy
hub / github.com/filebrowser/filebrowser / getSharePasswordHash

Function getSharePasswordHash

http/share.go:240–251  ·  view source on GitHub ↗
(body share.CreateBody)

Source from the content-addressed store, hash-verified

238})
239
240func getSharePasswordHash(body share.CreateBody) (data []byte, statuscode int, err error) {
241 if body.Password == "" {
242 return nil, 0, nil
243 }
244
245 hash, err := bcrypt.GenerateFromPassword([]byte(body.Password), bcrypt.DefaultCost)
246 if err != nil {
247 return nil, http.StatusInternalServerError, fmt.Errorf("failed to hash password: %w", err)
248 }
249
250 return hash, 0, nil
251}

Callers 1

share.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected