GithubHelp home page GithubHelp logo

akazwz / use-hashcode Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 134 KB

react use hashcode: hash大文件, hash 字符串, 支持 md5, sha1, sha256, sha512, 基于crypto-js

License: MIT License

HTML 5.25% TypeScript 94.75%
react hooks hash bigfile md5 sha1 sha256 sha512 cryptojs

use-hashcode's Introduction

Installation

npm:

npm i use-hashcode

yarn:

yarn add use-hashcode

Prepare

make sure you have crypto-js

npm i crypto-js

or

yarn add crypto-js

Summary

This package makes hash things easier in react using crypto-js

Usage

import { useFileHashCode } from 'use-hashcode'

const App = () => {
  const { isHashLoading, isHashError, sha256 } = useFileHashCode(file, 'sha256')
  const strMd5 = useStringHashCode('Hello, World', 'md5')

  return (
    <div>
      {sha256}
      {strMd5}
    </div>
  )
}

Hooks

1.useFileHashCode:

get hash code of file(include huge file), can custom chunk size, support MD5, Sha1, Sha256, Sha512

2.useStringHashCode:

get hash code of string, support MD5, Sha1, Sha256,Sha512

use-hashcode's People

Contributors

akazwz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.