3.1.0 • Published 7 months ago

hash-base v3.1.0

Weekly downloads
12,201,443
License
MIT
Repository
github
Last release
7 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@ct-note/table@ct-note/warning@ct-note/image@ct-note/inline-code@ct-note/list@ct-note/marker@ct-note/paragraph@ct-note/quote@ct-note/simple-image@ct-note/checklist@ct-note/code@ct-note/delimiter@ct-note/embed@ct-note/header@cube-design/react@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-tetris@simstudio/htmldiffdfeuk-frontenddfeuk-frontend-manual@kangarooswapfinance/v2-corestnenopmoc-iustock-ticker-react-widgetsolregex2tingzi-vuepresstinymce-plugin-toyu-library@artiso-solutions/vue-html-to-paper@aurelianoa/metadataupdatable@afria/afria-libraries@afolio/my-pass@buganto/client@carhoo/widget-dealers@classyllama/code-style@chakra-swap/core128981semzub@bonsaiswap-lib/lib@bonsaiswapv3/core@bonsaiswapv3/deploy@bowogfc/bbpolymer@devorso/dcountdown@danizean/cyberzonezona-xzubtesttodayvue-v3-yandex-metrikaverify-img-codevformlmq@farvater/open-pedigree@hproinformatica/functions@humafara/evmhuma@icetee/react-recaptcha-v3@elsouza1985/react-org-chart@eliteswap/v2-core@innoswap/core@innodata/vue-v3-ya-metrika
3.0.5

7 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

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