3.1.0 • Published 5 years ago

hash-base v3.1.0

Weekly downloads
12,201,443
License
MIT
Repository
github
Last release
5 years ago

hash-base

NPM Package Build Status Dependency status

js-standard-style

Abstract base class to inherit from if you want to create streams implementing the same API as node crypto Hash (for Cipher / Decipher check crypto-browserify/cipher-base).

Example

const HashBase = require('hash-base')
const inherits = require('inherits')

// our hash function is XOR sum of all bytes
function MyHash () {
  HashBase.call(this, 1) // in bytes

  this._sum = 0x00
}

inherits(MyHash, HashBase)

MyHash.prototype._update = function () {
  for (let i = 0; i < this._block.length; ++i) this._sum ^= this._block[i]
}

MyHash.prototype._digest = function () {
  return this._sum
}

const data = Buffer.from([ 0x00, 0x42, 0x01 ])
const hash = new MyHash().update(data).digest()
console.log(hash) // => 67

You also can check source code or crypto-browserify/md5.js

LICENSE

MIT

parse-asn1ripemd160md5.jsbrowserify-signcrypto-browserifyvuedragdropuploadimagespopsmart-common-authbb-chat@fundefund/funde_ckgql_din_mod@l1nyanm1ng/react-picture-viewercthpb-plugin-social@belko.tech/belko-multi-wallet-sdkcogoportutilsjs4cytoscape@saaspe/components@everything-registry/sub-chunk-1828cloutregulars-frontendtaman-baca-masyarakattest-carosello-campusvue-button-test1webchewebdesa-laravel-final-releasewescheme-jsshowgallerysamc2samc3samc4samc5sam-carouselrestakebotresponsive-react-appreactjs-github-widgetsupercluster-googlemaps-adapter-clonessticky-scroll-catchsearch-input-reactsearch-list-reactsequelcomponentreyhan-projecttestapatest-solidity-npmsvelte-component-libtextfield-samplevue-compmentvcloudcam-playkit-js-hlsviber-botkitvue-dev-clone@simstudio/htmldiffdfeuk-frontenddfeuk-frontend-manual@kangarooswapfinance/v2-coremiguelcostero-ng2-toastymiracle-webpack-tree-shakingloading-animatedhelp-widgetgrid-component-react-ex-1gnrl.jsjesusdemojs-utils-jll2jsonld-signatures-merkleproof2019iris-node-js-sdkiris-embedded-sdkm2m-chartjs-plugin-crosshairmggauharlitepie-datepicker-gabekafirchain-tetrishive-multisig-sdkhot-zone-vueguruwayguruway.jshardhat-teaplughardhat-teaxyzlrbceshiparvan_componentsparvan_reactjs_componentsoutils-renowt-client-javascriptprova-2-caroselloprova-cmpprova-cpm-2prova-cpm-3prova-cpm-4ptg-airdropplaykit-js-hls-sondqng-search-dropdownpixiu-swap-corepixiuswap-libs-sdkqyx-hmtldiffreact-form-component-libraryreact-redux-demo1react-otp-input-uptdnois-react-toastquadratic-sdkreact-misc-toolboxqa_hddqudratic-uiregression-external-dtostnenopmoc-iustock-ticker-react-widgetsmtr
3.1.0

5 years ago

3.0.4

8 years ago

3.0.3

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

3.0.0

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago