We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c37a1a2 commit eab72fcCopy full SHA for eab72fc
src/components/Auth/Apiker/utils.ts
@@ -150,6 +150,22 @@ export const randomHash_SHA1 = (): string => {
150
return CryptoJS.SHA1(wordArray).toString(CryptoJS.enc.Hex);
151
};
152
153
+/**
154
+ * Creates SHA256 hash
155
+ */
156
+export const stringHash = (content: string) => {
157
+ const wordArray = CryptoJS.lib.WordArray.create(content);
158
+ return CryptoJS.SHA256(wordArray).toString(CryptoJS.enc.Hex);
159
+};
160
+
161
162
+ * Creates a random SHA1 hash
163
164
+export const stringHash_SHA1 = (content): string => {
165
166
+ return CryptoJS.SHA1(wordArray).toString(CryptoJS.enc.Hex);
167
168
169
/**
170
* Generating a clientId
171
* This value is returned to client and not stored
0 commit comments