3.1.0 • Published 1 year ago

hash-base v3.1.0

Weekly downloads
12,201,443
License
MIT
Repository
github
Last release
1 year 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-clonegenerator-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-checkoutbainfrdrk-js-semaphoreforminput-ui-libfreemambafn-lib-examplefork-react-ffmpeggdom.jsgassefalsgassefals-2gdom-0.0.1generaljs-2021dynamics-contracts-xeasyplayer-myeditorjs-alerticonsemg-apienefti-galerievmhumafhir2fastlion-picture-viewerflowable-bpmn-modelerfahad-redux-axios-midlewarecampus-carosellocampus1campus2campus3campus4canvas-fingerprintcar-cmp-2caropcarop2carop3carop4
3.0.5

1 year ago

3.1.0

6 years ago

3.0.4

9 years ago

3.0.3

9 years ago

3.0.2

9 years ago

3.0.1

10 years ago

3.0.0

10 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