@firebase/util 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,3 +37,4 @@ export * from './src/formatters';
37
37
  export * from './src/compat';
38
38
  export * from './src/global';
39
39
  export * from './src/url';
40
+ export * from './src/sha256';
@@ -37,3 +37,4 @@ export * from './src/formatters';
37
37
  export * from './src/compat';
38
38
  export * from './src/global';
39
39
  export * from './src/url';
40
+ export * from './src/sha256';
@@ -37,3 +37,4 @@ export * from './src/formatters';
37
37
  export * from './src/compat';
38
38
  export * from './src/global';
39
39
  export * from './src/url';
40
+ export * from './src/sha256';
@@ -2314,6 +2314,39 @@ function getModularInstance(service) {
2314
2314
  }
2315
2315
  }
2316
2316
 
2317
+ /**
2318
+ * @license
2319
+ * Copyright 2025 Google LLC
2320
+ *
2321
+ * Licensed under the Apache License, Version 2.0 (the "License");
2322
+ * you may not use this file except in compliance with the License.
2323
+ * You may obtain a copy of the License at
2324
+ *
2325
+ * http://www.apache.org/licenses/LICENSE-2.0
2326
+ *
2327
+ * Unless required by applicable law or agreed to in writing, software
2328
+ * distributed under the License is distributed on an "AS IS" BASIS,
2329
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2330
+ * See the License for the specific language governing permissions and
2331
+ * limitations under the License.
2332
+ */
2333
+ /**
2334
+ * @public
2335
+ * Generates a SHA-256 hash for the given input string.
2336
+ *
2337
+ * @param input The string to hash.
2338
+ * @returns A promise that resolves to the SHA-256 hash as a hex string.
2339
+ */
2340
+ async function generateSHA256Hash(input) {
2341
+ const textEncoder = new TextEncoder();
2342
+ const data = textEncoder.encode(input);
2343
+ const hashBuffer = await crypto.subtle.digest('SHA-256', data);
2344
+ // Convert ArrayBuffer to hex string
2345
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
2346
+ const hexHash = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
2347
+ return hexHash;
2348
+ }
2349
+
2317
2350
  /**
2318
2351
  * @license
2319
2352
  * Copyright 2017 Google LLC
@@ -2333,5 +2366,5 @@ function getModularInstance(service) {
2333
2366
  // Overriding the constant (we should be the only ones doing this)
2334
2367
  CONSTANTS.NODE_CLIENT = true;
2335
2368
 
2336
- export { CONSTANTS, DecodeBase64StringError, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, base64urlEncodeWithoutPadding, calculateBackoffMillis, contains, createMockUserToken, createSubscribe, decode, deepCopy, deepEqual, deepExtend, errorPrefix, extractQuerystring, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getDefaults, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isCloudWorkstation, isCloudflareWorker, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isSafariOrWebkit, isUWP, isValidFormat, isValidTimestamp, isWebWorker, issuedAtTime, jsonEval, map, ordinal, pingServer, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, updateEmulatorBanner, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };
2369
+ export { CONSTANTS, DecodeBase64StringError, Deferred, ErrorFactory, FirebaseError, MAX_VALUE_MILLIS, RANDOM_FACTOR, Sha1, areCookiesEnabled, assert, assertionError, async, base64, base64Decode, base64Encode, base64urlEncodeWithoutPadding, calculateBackoffMillis, contains, createMockUserToken, createSubscribe, decode, deepCopy, deepEqual, deepExtend, errorPrefix, extractQuerystring, generateSHA256Hash, getDefaultAppConfig, getDefaultEmulatorHost, getDefaultEmulatorHostnameAndPort, getDefaults, getExperimentalSetting, getGlobal, getModularInstance, getUA, isAdmin, isBrowser, isBrowserExtension, isCloudWorkstation, isCloudflareWorker, isElectron, isEmpty, isIE, isIndexedDBAvailable, isMobileCordova, isNode, isNodeSdk, isReactNative, isSafari, isSafariOrWebkit, isUWP, isValidFormat, isValidTimestamp, isWebWorker, issuedAtTime, jsonEval, map, ordinal, pingServer, promiseWithTimeout, querystring, querystringDecode, safeGet, stringLength, stringToByteArray, stringify, updateEmulatorBanner, validateArgCount, validateCallback, validateContextObject, validateIndexedDBOpenable, validateNamespace };
2337
2370
  //# sourceMappingURL=index.node.esm.js.map