You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `exists` and `get` functions can be used to check whether a multicodec with given name or code is known, and if so to get the corresponding object:
64
+
Core functionality is provided by the `get`, `exists`, `wrap` and `unwrap` functions.
65
+
The `get` and `exists` functions can be used to check whether a multicodec with given name or code is known,
>>> ip4.unwrap(bytes.fromhex('00c0a800fe')) # 'identity' multicodec data
120
+
multiformats.multicodec.err.ValueError: Found code 0x00 when unwrapping data, expected code 0x04.
121
+
```
122
+
80
123
The `table` function can be used to iterate through known multicodecs, optionally restrictiong to one or more tags and/or statuses:
81
124
82
125
```py
@@ -143,44 +186,72 @@ For advanced usage, see the [API documentation](https://hashberg-io.github.io/mu
143
186
### Multihash
144
187
145
188
The `multihash` module implements the [multihash spec](https://github.com/multiformats/multihash).
146
-
The `exists` and `get` functions can be used to check whether a multihash multicodec with given name or code is known, and if so to get the corresponding object:
147
-
148
189
149
-
Core functionality is provided by the `digest`, `encode`, `decode` functions.
150
-
The `digest` function can be used to create a multihash digest directly from data:
190
+
Core functionality is provided by the `digest`, `wrap`, `unwrap` functions, or the correspondingly-named methods of the `Multihash` class.
191
+
The `digest` function and `Multihash.digest` method can be used to create a multihash digest directly from data:
0 commit comments