@firebase/util 1.13.0-20250716201504 → 1.13.0-caching-fdc.9f17eac6e
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.
- package/dist/index.cjs.js +27 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +27 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.node.cjs.js +27 -0
- package/dist/index.node.cjs.js.map +1 -1
- package/dist/index.node.d.ts +1 -0
- package/dist/node-esm/index.d.ts +1 -0
- package/dist/node-esm/index.node.d.ts +1 -0
- package/dist/node-esm/index.node.esm.js +27 -1
- package/dist/node-esm/index.node.esm.js.map +1 -1
- package/dist/node-esm/src/sha256.d.ts +17 -0
- package/dist/src/sha256.d.ts +17 -0
- package/dist/util-public.d.ts +18 -0
- package/dist/util.d.ts +18 -0
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2318,6 +2318,32 @@ function getModularInstance(service) {
|
|
|
2318
2318
|
}
|
|
2319
2319
|
}
|
|
2320
2320
|
|
|
2321
|
+
/**
|
|
2322
|
+
* @license
|
|
2323
|
+
* Copyright 2025 Google LLC
|
|
2324
|
+
*
|
|
2325
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2326
|
+
* you may not use this file except in compliance with the License.
|
|
2327
|
+
* You may obtain a copy of the License at
|
|
2328
|
+
*
|
|
2329
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2330
|
+
*
|
|
2331
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2332
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2333
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2334
|
+
* See the License for the specific language governing permissions and
|
|
2335
|
+
* limitations under the License.
|
|
2336
|
+
*/
|
|
2337
|
+
async function generateSHA256HashBrowser(input) {
|
|
2338
|
+
const textEncoder = new TextEncoder();
|
|
2339
|
+
const data = textEncoder.encode(input);
|
|
2340
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
|
|
2341
|
+
// Convert ArrayBuffer to hex string
|
|
2342
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
2343
|
+
const hexHash = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
|
|
2344
|
+
return hexHash;
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2321
2347
|
exports.CONSTANTS = CONSTANTS;
|
|
2322
2348
|
exports.DecodeBase64StringError = DecodeBase64StringError;
|
|
2323
2349
|
exports.Deferred = Deferred;
|
|
@@ -2344,6 +2370,7 @@ exports.deepEqual = deepEqual;
|
|
|
2344
2370
|
exports.deepExtend = deepExtend;
|
|
2345
2371
|
exports.errorPrefix = errorPrefix;
|
|
2346
2372
|
exports.extractQuerystring = extractQuerystring;
|
|
2373
|
+
exports.generateSHA256HashBrowser = generateSHA256HashBrowser;
|
|
2347
2374
|
exports.getDefaultAppConfig = getDefaultAppConfig;
|
|
2348
2375
|
exports.getDefaultEmulatorHost = getDefaultEmulatorHost;
|
|
2349
2376
|
exports.getDefaultEmulatorHostnameAndPort = getDefaultEmulatorHostnameAndPort;
|