3.1.0 • Published 11 months ago

hash-base v3.1.0

Weekly downloads
12,201,443
License
MIT
Repository
github
Last release
11 months 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.jscrypto-browserifybrowserify-signvuedragdropuploadimagespopsmart-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-jssupercluster-googlemaps-adapter-clonessticky-scroll-catchtestapatest-solidity-npmsvelte-component-libtextfield-samplevue-compmentvcloudcam-playkit-js-hlsviber-botkitvue-dev-clone@borealisswap/borealis-swap-lib@blkmarketco/components-library@beldore/react-otp-input@caneco/siema@percent/percent-api-hooks@rbc-public/react-selectable-fastgenerator-bootstrap-boilerplate-templatejesusdemojs-utils-jll2iris-embedded-sdkiris-node-js-sdkjsonld-signatures-merkleproof2019kafirchain-tetrishot-zone-vuehive-multisig-sdkgrid-component-react-ex-1hardhat-teaplughardhat-teaxyzguruwayguruway.jshelp-widgetlitepie-datepicker-gabelrbceshim2m-chartjs-plugin-crosshairloading-animated@thismr/bitmindtest-core@tillschweneker/ckeditor5-build-strapi-wysiwyg-markdown@udooku/react-image-comparison-slider@tonysusi/vapid@thedoctor0/vuex-shared-mutations@vitali_shcherbina/styled-lib@xswap/v2-core@yak-spirit/yak-swap-ui@zalastax/nolb-hash@zh0st/evm-chains@zebracompany/f_editora_react_reflux_demob2x-utilsap-vue-captchaappcharge-checkoutbain@aurelianoa/metadataupdatable@classyllama/code-style128981semzub@clinkchat/tiny-emitter@afria/afria-libraries@afolio/my-pass@simstudio/htmldiffdfeuk-frontenddfeuk-frontend-manual@kangarooswapfinance/v2-corestnenopmoc-iustock-ticker-react-widgetsolregex2tingzi-vuepresstinymce-plugin-toyu-library@buganto/client@carhoo/widget-dealers@chakra-swap/core@bonsaiswap-lib/lib@bonsaiswapv3/core@bonsaiswapv3/deploy@bowogfc/bbpolymerzona-xzubtesttoday
3.0.5

11 months ago

3.1.0

5 years ago

3.0.4

8 years ago

3.0.3

9 years ago

3.0.2

9 years ago

3.0.1

9 years ago

3.0.0

9 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago