fromPrefixBytes static method
Reconstructs a CID from a prefix (version + codec + multihash function
- hash length) and the raw block
data.
The digest is computed from data using the provided hashType. The
resulting CID is only valid if the computed prefix matches the supplied
prefix, which is verified by validate.
Implementation
static Future<CID> fromPrefixBytes(
Uint8List prefix,
Uint8List data, {
String hashType = 'sha2-256',
}) async {
final codec = _codecFromPrefixBytes(prefix);
return fromContent(data, codec: codec, hashType: hashType);
}