cic-contracts/solidity/MultiHash.sol
2023-03-25 12:32:56 +00:00

23 lines
637 B
Solidity

pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
// SPDX-License-Identifier: AGPL-3.0-or-later
// File-version: 2
interface IMultiHash {
// Represents a multicodec item.
struct MultiHash {
uint8 l;
uint8 codecRLength;
uint8 prefixRLength;
bytes16 prefix;
bytes8 codec;
}
// All registered multicodecs
function multiCodec(uint256 _codec) external view returns(MultiHash memory);
// Generate a multihash from the given digest and current selected multicodec
function toMultiHash(uint256 _codec, bytes memory _digest) external view returns(bytes memory);
}