Skip to content

Commit 175967d

Browse files
authored
Filecoin codec and hash types (#84)
Signed-off-by: artyom-yurin <[email protected]>
1 parent b7712da commit 175967d

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

include/libp2p/multi/hash_type.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#define LIBP2P_HASH_TYPE_HPP
88

99
namespace libp2p::multi {
10-
/// TODO(Harrm) FIL-14: Hash types are a part of multicodec table, it would be good to
11-
/// move them there to avoid duplication and allow for extraction of
10+
/// TODO(Harrm) FIL-14: Hash types are a part of multicodec table, it would be
11+
/// good to move them there to avoid duplication and allow for extraction of
1212
/// human-friendly name of a type from its code
1313
/// @see MulticodecType
1414
/// https://github.com/multiformats/js-multihash/blob/master/src/constants.js
@@ -19,7 +19,9 @@ namespace libp2p::multi {
1919
sha512 = 0x13,
2020
blake2b_256 = 0xb220,
2121
blake2s128 = 0xb250,
22-
blake2s256 = 0xb260
22+
blake2s256 = 0xb260,
23+
sha2_256_trunc254_padded = 0x1012,
24+
poseidon_bls12_381_a1_fc1 = 0xb401,
2325
};
2426
} // namespace libp2p::multi
2527

include/libp2p/multi/multicodec_type.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ namespace libp2p::multi {
3333
RAW = 0x55,
3434
DAG_PB = 0x70,
3535
DAG_CBOR = 0x71,
36+
FILECOIN_COMMITMENT_UNSEALED = 0xf101,
37+
FILECOIN_COMMITMENT_SEALED = 0xf102,
3638
};
3739

3840
static std::string getName(Code code) {
@@ -59,6 +61,10 @@ namespace libp2p::multi {
5961
return "dag-pb";
6062
case Code::DAG_CBOR:
6163
return "dag-cbor";
64+
case Code::FILECOIN_COMMITMENT_UNSEALED:
65+
return "fil-commitment-unsealed";
66+
case Code::FILECOIN_COMMITMENT_SEALED:
67+
return "fil-commitment-sealed";
6268
}
6369
return "unknown";
6470
}

0 commit comments

Comments
 (0)