API reference / @jsprismarine/management-protocol / secret
secret
Variables
SECRET_LENGTH
constSECRET_LENGTH:40=40
Defined in: secret.ts:12
How long a secret is.
Functions
generateSecret()
generateSecret():
string
Defined in: secret.ts:18
A new secret, from a cryptographic random source.
Returns
string
isValidSecret()
isValidSecret(
value):boolean
Defined in: secret.ts:15
Whether a value can be a management secret: 40 characters from A-Z, a-z and 0-9.
Parameters
value
string
Returns
boolean
secretMatches()
secretMatches(
secret,offered):boolean
Defined in: secret.ts:25
Whether what a client sent is the secret, compared in time that does not depend on where the two first differ.
Parameters
secret
string
offered
string
Returns
boolean