cid 1.0.0 copy "cid: ^1.0.0" to clipboard
cid: ^1.0.0 copied to clipboard

A dart-lang implementation for creating self-describing content-addressed identifiers for distributed systems (CIDs).

example/example.dart

import 'package:cid/cid.dart';

// Creating a v1 CID.
String input = 'hello world';
CIDInfo output = CID.createCid(input, Multibase.base58btc);

var cid = output.cid;
// "zb2rhj7crUKTQYRGCRATFaQ6YFLTde2YzdqbbhAASkL9uRDXn"

// Decoding a given CID
String v0Cid = 'QmcRD4wkPPi6dig81r5sLj9Zm1gDCL4zgpEj9CfuRrGbzF';
var decodedV0CID = CID.decodeCid(v0Cid);

// Convert a given CID object to v1
var v1Cid = CID.decodeCid(v0Cid).toV1();
var cidString = v1Cid.cid;
// "bafybeigrf2dwtpjkiovnigysyto3d55opf6qkdikx6d65onrqnfzwgdkfa"
2
likes
140
pub points
30%
popularity

Publisher

verified publisherdwyl.com

A dart-lang implementation for creating self-describing content-addressed identifiers for distributed systems (CIDs).

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

base32, bs58, buffer, convert, crypto, dart_multihash

More

Packages that depend on cid