Skip to content

Commit

Permalink
chore: method signatures for sha256 method
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Jan 11, 2020
1 parent 12ef2f4 commit 836bd9a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions assets/js/oauth.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ const generateRandomString = () => {
window.crypto.getRandomValues(array);
return Array.from(array, dec => `0${dec.toString(16)}`.substr(-2)).join("");
};
// Calculate the SHA256 hash of the input text.
// Returns a promise that resolves to an ArrayBuffer

/**
* Calculate the SHA256 hash of the input text
*
* @returns {Promise<ArrayBuffer>}
*/

const sha256 = plain => {
const encoder = new TextEncoder();
const data = encoder.encode(plain);
Expand Down

0 comments on commit 836bd9a

Please sign in to comment.