From 959a7c9490942d9ac3670f1ef608695e71a63ef3 Mon Sep 17 00:00:00 2001 From: Tobias Schneider Date: Thu, 4 Feb 2021 12:42:33 +0100 Subject: [PATCH] Updated readme --- README.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6ca1d9b..818833d 100644 --- a/README.md +++ b/README.md @@ -29,33 +29,48 @@ const payload = jwt.decode(token) Signs a payload and returns the token. + `payload` -Can be an object, buffer or a string. + +The payload object. + `secret` + A string which is used to sign the payload. + `algorithm` (optional, default: `HS256`) -The algorithm used to sign the payload, possible values: `HS256`(default) or `HS512` + +The algorithm used to sign the payload, possible values: `HS256` or `HS512` ### `jwt.verify(token, secret, [algorithm])` Verifies the integrity of the token and returns a boolean value. + `token` + The token string generated by `jwt.sign()`. + `secret` + A string which is used to sign the payload. + `algorithm` (optional, default: `HS256`) -The algorithm used to sign the payload, possible values: `HS256`(default) or `HS512` + +The algorithm used to sign the payload, possible values: `HS256` or `HS512` ### `jwt.decode(token)` + Returns the payload without verifying the integrity of the token. + `token` + The token string generated by `jwt.sign()`.