Skip to main content

Function: deriveClientSalt()

deriveClientSalt(userUid): Buffer

Defined in: auth/src/auth/shared.ts:1087

Derives the deterministic salt a client uses to hash a password locally: the SHA-256 digest of the account's uid. Using uid (immutable, unique, returned on every successful login) rather than an email/username avoids the salt changing if the account's contact info is later edited, and sidesteps ambiguity when an account has multiple aliases — uid is the same no matter which alias was used to authenticate. A client that doesn't yet know its account's uid (e.g. its first-ever login on a new device) has no way to compute this and must fall back to submitting a raw password instead.

Parameters​

userUid​

string

Returns​

Buffer