File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -294,6 +294,7 @@ export interface Net {
294
294
removeCookies ( domain ?: string ) : Promise < null > ;
295
295
}
296
296
297
+ type HashAlgorithm = "md5" | "sha1" | "sha224" | "sha256" | "sha384" | "sha512" ;
297
298
export interface FS {
298
299
RNFetchBlobSession : RNFetchBlobSession ;
299
300
@@ -317,6 +318,14 @@ export interface FS {
317
318
318
319
ls ( path : string ) : Promise < string [ ] > ;
319
320
321
+ /**
322
+ * Read the file from the given path and calculate a cryptographic hash sum over its contents.
323
+ *
324
+ * @param path Path to the file
325
+ * @param algorithm The hash algorithm to use
326
+ */
327
+ hash ( path : string , algorithm : HashAlgorithm ) : Promise < string > ;
328
+
320
329
/**
321
330
* Create file stream from file at `path`.
322
331
* @param path The file path.
You can’t perform that action at this time.
0 commit comments