# cordova-plugin-file-hash

> Cordova FileHash Plugin

Latest version **0.4.1** (published 2016-07-20) · Apache 2.0 license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-file-hash
pnpm add cordova-plugin-file-hash
yarn add cordova-plugin-file-hash
bun add cordova-plugin-file-hash
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.1 |
| Published | 2016-07-20 |
| First published | 2016-07-11 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | LordKBX |
| Maintainers | lordkbx |
| Keywords | cordova, file, hash, file-hash, checksum, cordova-plugin, cordova-plugin-file-hash, ecosystem:cordova, cordova-android, cordova-ios |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-file-hash
- Repository: https://github.com/LordKBX/cordova-plugin-file-hash
- Homepage: https://github.com/LordKBX/cordova-plugin-file-hash#readme
- Issues: https://github.com/LordKBX/cordova-plugin-file-hash/issues
- npm.io page: https://npm.io/package/cordova-plugin-file-hash

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.4.1 (latest) — 2016-07-20
- 0.4.0 — 2016-07-20
- 0.3.2 — 2016-07-16
- 0.3.1 — 2016-07-15
- 0.3.0 — 2016-07-15
- 0.2.0 — 2016-07-12
- 0.1.1 — 2016-07-11
- 0.1.0 — 2016-07-11

## README

# cordova-plugin-file-hash
This plugin provides file hash functions
##Version 0.4.1
##Platforms
|**Android**|**IOS**|
|:---:|:---:|
|&gt;=5.0|&gt;= 8.0|


If your intrested i search help for an adaptation on Windows Phone(W10 ?), in that case leave a message [here](https://github.com/LordKBX/cordova-plugin-file-hash/issues)

###***list of functions***
|**md2**|**md5**|**sha1**|**sha256**|**sha384**|**sha512**|
|:---:|:---:|:---:|:---:|:---:|:---:|

###***functions usage***

    [window.]FileHash.<function_name>(<file_absolute_path>, successCallback, errorCallback);

![warning](https://cdn1.iconfinder.com/data/icons/nuove/32x32/actions/messagebox_warning.png) require and absolute path(file:// format, use [cordova-plugin-file](https://www.npmjs.com/package/cordova-plugin-file) for retrieve the appfolder)

the successCallback function receive a JSON structure, here the content of the structure

    Object{file: "<file_absolute_path>", algo: "<function_algorithm>", result: "<returned_file_hash>"}

the errorCallback function receive a JSON structure, here the content of the structure

    Object{code: <int_return_code>, message: "<error_description>"}
	
###***List of error codes***
|code|message|additional informations|
|:---:|:---|:---|
|0|Execution Error|unknow error|
|1|Unknown Algorithm|-|
|2|File not found|on IOS was also send in case of access error|
|3|File access error|no sufficents access rights or already used file|
|4|Digest error|cryptography processing error|

###***Exemple on Android***
![warning](https://cdn1.iconfinder.com/data/icons/nuove/32x32/actions/messagebox_warning.png) this exemple use [cordova-plugin-file](https://www.npmjs.com/package/cordova-plugin-file) for retrieve the appfolder(cordova.file.applicationDirectory)

    FileHash.md5(cordova.file.applicationDirectory+'www/index.html',function(e){console.log(e);}

Result

    Object {file: "file:///android_asset/www/index.html", algo: "MD5", result: "5b8a987f7d13a5afa7bb86bb2b0eab90"}


> Written with [StackEdit](https://stackedit.io/).

---
_Source: https://npm.io/package/cordova-plugin-file-hash · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
