MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / isBcryptHash

Function isBcryptHash

internal/web/api_v1_users.go:121–123  ·  view source on GitHub ↗

isBcryptHash returns true when s already looks like a bcrypt hash so we do not double-hash a value that was round-tripped through the API.

(s string)

Source from the content-addressed store, hash-verified

119// isBcryptHash returns true when s already looks like a bcrypt hash so we do
120// not double-hash a value that was round-tripped through the API.
121func isBcryptHash(s string) bool {
122 return len(s) > 4 && (s[:4] == "$2a$" || s[:4] == "$2b$")
123}
124
125// POST /admin/api/v1/users
126func apiV1CreateUser(w http.ResponseWriter, r *http.Request) {

Callers 1

apiV1PatchUserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected