Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

chore: method signatures for sha256 method

jamesgeorge007836bd9ab3c12
diff --git a/assets/js/oauth.js b/assets/js/oauth.js
index f9a58bdba..d9cabff26 100644
--- a/assets/js/oauth.js
+++ b/assets/js/oauth.js
@@ -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);