@google-cloud/storage
Advanced tools
Comparing version 6.5.4 to 6.6.0
/// <reference types="node" /> | ||
/// <reference types="node" /> | ||
import { PathLike } from 'fs'; | ||
/** | ||
@@ -122,2 +124,3 @@ * Ported from {@link https://github.com/google/crc32c/blob/21fc8ef30415a635e7351ffa0e5d5367943d4a94/src/crc32c_portable.cc#L16-L59 github.com/google/crc32c} | ||
private static fromBuffer; | ||
static fromFile(file: PathLike): Promise<CRC32C>; | ||
/** | ||
@@ -137,2 +140,3 @@ * Generates a `CRC32C` from 4-byte base64-encoded data (string). | ||
* Generates a `CRC32C` from a variety of compatable types. | ||
* Note: strings are treated as input, not as file paths to read from. | ||
* | ||
@@ -139,0 +143,0 @@ * @param value A number, 4-byte `ArrayBufferView`/`Buffer`/`TypedArray`, or 4-byte base64-encoded data (string) |
@@ -29,2 +29,3 @@ "use strict"; | ||
exports.CRC32C_EXTENSION_TABLE = exports.CRC32C_EXTENSIONS = exports.CRC32C_EXCEPTION_MESSAGES = exports.CRC32C_DEFAULT_VALIDATOR_GENERATOR = exports.CRC32C = void 0; | ||
const fs_1 = require("fs"); | ||
/** | ||
@@ -195,2 +196,12 @@ * Ported from {@link https://github.com/google/crc32c/blob/21fc8ef30415a635e7351ffa0e5d5367943d4a94/src/crc32c_portable.cc#L16-L59 github.com/google/crc32c} | ||
} | ||
static async fromFile(file) { | ||
const crc32c = new CRC32C(); | ||
await new Promise((resolve, reject) => { | ||
(0, fs_1.createReadStream)(file) | ||
.on('data', (d) => crc32c.update(d)) | ||
.on('end', resolve) | ||
.on('error', reject); | ||
}); | ||
return crc32c; | ||
} | ||
/** | ||
@@ -221,2 +232,3 @@ * Generates a `CRC32C` from 4-byte base64-encoded data (string). | ||
* Generates a `CRC32C` from a variety of compatable types. | ||
* Note: strings are treated as input, not as file paths to read from. | ||
* | ||
@@ -223,0 +235,0 @@ * @param value A number, 4-byte `ArrayBufferView`/`Buffer`/`TypedArray`, or 4-byte base64-encoded data (string) |
{ | ||
"name": "@google-cloud/storage", | ||
"description": "Cloud Storage Client Library for Node.js", | ||
"version": "6.5.4", | ||
"version": "6.6.0", | ||
"license": "Apache-2.0", | ||
@@ -83,3 +83,3 @@ "author": "Google Inc.", | ||
"@types/mockery": "^1.4.29", | ||
"@types/node": "^17.0.30", | ||
"@types/node": "^18.0.0", | ||
"@types/node-fetch": "^2.1.3", | ||
@@ -86,0 +86,0 @@ "@types/proxyquire": "^1.3.28", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
807865
16324
6