fromMultihash static method
Creates a PeerId from a multihash
Implementation
static PeerId fromMultihash(Uint8List bytes) {
// Validate that the bytes are a valid multihash
try {
Multihash.decode(bytes);
return PeerId(bytes);
} catch (e) {
throw FormatException('Invalid multihash: $e');
}
}