3.1.0 • Published 4 years ago

hash-base v3.1.0

Weekly downloads
12,201,443
License
MIT
Repository
github
Last release
4 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

ripemd160parse-asn1md5.jsbrowserify-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-frontendsam-carouseldictadebitisjs-utils-jll2date-to-block-ethkafirchain-tetrisdemo-component-skyflyer86jsonld-signatures-merkleproof2019design-system-fitbank-450responsive-react-appcpm-8course-vue-tpl@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/table@ct-note/warningreact-otp-input-uptd@cube-design/reactconstellation-frontend@devorso/dcountdowniris-node-js-sdkcotrader-dex-sdkcosmos-atom-hdwalletcpm-12cpm-13cpm-14cpm-15cpm-16cpm-17cpm-18cpm-19cpm-20cpm-21cpm-5cpm-6cpm-7cpm-10cpm-11cpm-9cpm-defreyhan-projectlitepie-datepicker-gabem2m-chartjs-plugin-crosshairsipengine-modalsmtrsolregex2lrbceshisticky-scroll-catchstnenopmoc-iustock-ticker-react-widgetdiscord.js-byconsequelcomponentdiscordjs-con-selfsearch-input-reactsearch-list-reactsupercluster-googlemaps-adapter-clonessvelte-component-libtaman-baca-masyarakatmiracle-webpack-tree-shakingeasyplayer-mydynamics-contracts-xvcloudcam-playkit-js-hlsnois-react-toasteditorjs-alerticonstingzi-vuepresstinymce-plugin-toytest-carosello-campusng-search-dropdownvue-dev-cloneu-libraryvue-button-test1mggauharmiguelcostero-ng2-toastytextfield-sampletest-solidity-npmtestapavformlmq@simstudio/htmldiff@sudophunk/fulido
3.1.0

4 years ago

3.0.4

7 years ago

3.0.3

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

3.0.0

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago