cic-contracts/solidity/MultiHash.sol

25 lines
714 B
Solidity
Raw Normal View History

pragma solidity >=0.6.12;
// Author: Louis Holbrook <dev@holbrook.no> 0826EDA1702D1E87C6E2875121D2E7BB88C2A746
2023-03-25 13:32:56 +01:00
// 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
2023-03-26 13:04:31 +02:00
function digestCodec(uint256 _codec) external view returns(MultiHash memory);
function haveDigestEncoding(uint256 _codec) external view returns(bool);
// Generate a multihash from the given digest and current selected multicodec
2023-03-26 13:04:31 +02:00
function encodeDigest(uint256 _codec, bytes memory _digest) external view returns(bytes memory);
}