@web3-storage/data-segment
TypeScript icon, indicating that this package has built-in type declarations

5.3.0 • Public • Published

@web3-storage/data-segment

Implementation of the FRC-0058 verifiable aggregation scheme.

API

import { Piece, MIN_PAYLOAD_SIZE } from "@web3-storage/data-segment"

// input must be >= 65 bytes
const bytes = new Uint8Array(MIN_PAYLOAD_SIZE)

const piece = Piece.fromPayload(bytes)

// bafkzcibbai3tdo4zvruj6zxo6wlt4suu3imi6to4vzmaojh4n475mdp5jcbtg
const cid = piece.link.toSting()

Prior Art

Started as fork of js-fil-utils modernizing it to use ES modules and web crypto APIs in place of node APIs.

However, js-fil-utils produces different results from the more widely used go implementation which is why it got some heavy lifting inspired by go-data-segment and go-fil-commp-hashhash libraries.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
5.3.01,657latest

Version History

VersionDownloads (Last 7 Days)Published
5.3.01,657
5.2.0680
5.1.0768
5.0.059
4.0.0524
3.2.01,594
3.1.00
3.0.14
3.0.00
2.2.00
2.1.00
2.0.00
2.0.0-dev-10
2.0.0-dev0
1.0.10
1.0.00

Package Sidebar

Install

npm i @web3-storage/data-segment

Weekly Downloads

4,488

Version

5.3.0

License

(Apache-2.0 AND MIT)

Unpacked Size

160 kB

Total Files

78

Last publish

Collaborators

  • it-dag-house
  • gozala
  • olizilla
  • vascosantos
  • alanshaw