chore: method signatures for base64urlencode method

This commit is contained in:
jamesgeorge007
2020-01-11 13:24:04 +05:30
parent 836bd9ab3c
commit 3ba279c81b

View File

@@ -96,7 +96,14 @@ const sha256 = plain => {
const data = encoder.encode(plain);
return window.crypto.subtle.digest("SHA-256", data);
};
// Base64-urlencodes the input string
/**
* Base64-urlencodes the input string
*
* @param {String} str - The string to be converted
* @returns {Promise<ArrayBuffer>}
*/
const base64urlencode = (
str // Convert the ArrayBuffer to string using Uint8 array to convert to what btoa accepts.
) =>