npm install use-hashcodenpm:
``shell`
npm i use-hashcode
yarn:
`shell`
yarn add use-hashcode
shell
npm i crypto-js
`
or
`shell
yarn add crypto-js
`Summary
This package makes hash things easier in react using crypto-js
Usage
``tsx
import { useFileHashCode } from 'use-hashcode'const App = () => {
const { isHashLoading, isHashError, sha256 } = useFileHashCode(file, 'sha256')
const strMd5 = useStringHashCode('Hello, World', 'md5')
return (
{sha256}
{strMd5}
)
}
```#### get hash code of file(include huge file), can custom chunk size, support MD5, Sha1, Sha256, Sha512
#### get hash code of string, support MD5, Sha1, Sha256,Sha512