Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@web3-storage/car-block-validator

Package Overview
Dependencies
Maintainers
7
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web3-storage/car-block-validator

Validate car block bytes

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
Created
Source

car-block-validator

Validate car block bytes with web3.storage supported codecs

Build

car-block-validator validates @ipld/car blocks for the given hashers:

hashesimportrepo
sha2-256, sha2-512multiformats/hashes/sha2multiformats/js-multiformats
sha3-224, sha3-256, sha3-384,sha3-512, shake-128, shake-256, keccak-224, keccak-256, keccak-384, keccak-512@multiformats/sha3multiformats/js-sha3
identitymultiformats/hashes/identitymultiformats/js-multiformats
murmur3-128, murmur3-32@multiformats/murmur3multiformats/js-murmur3
blake2b-*, blake2s-*@multiformats/blake2multiformats/js-blake2

Install

# install it as a dependency
$ npm i @web3-storage/car-block-validator

Usage

import { validateBlock } from '@web3-storage/car-block-validator'

// Read CAR file as wished
// const inStream = fs.createReadStream(process.argv[2])
// const reader = await CarBlockIterator.fromIterable(inStream)

for await (const block of reader) {
  await validateBlock(block)
  // throws if not valid, either unknown codec or not valid bytes
}

Keywords

FAQs

Package last updated on 08 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc