Compare commits

...

3 Commits

Author SHA1 Message Date
semantic-release-bot 4fe84d68fb chore(release): 0.1.0-develop.59 [skip ci]
# [0.1.0-develop.59](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.58...v0.1.0-develop.59) (2023-09-11)

### Features

* add fromRegistryPublicKey helper ([e250878](e25087890f))
2023-09-11 17:22:27 +00:00
Derrick Hammer 6cf2481164
Merge remote-tracking branch 'origin/develop' into develop 2023-09-11 13:21:45 -04:00
Derrick Hammer e25087890f
feat: add fromRegistryPublicKey helper 2023-09-11 13:21:39 -04:00
4 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,10 @@
# [0.1.0-develop.59](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.58...v0.1.0-develop.59) (2023-09-11)
### Features
* add fromRegistryPublicKey helper ([e250878](https://git.lumeweb.com/LumeWeb/libs5/commit/e25087890f1d19139da5152e0d18b6001911baff))
# [0.1.0-develop.58](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.57...v0.1.0-develop.58) (2023-09-11) # [0.1.0-develop.58](https://git.lumeweb.com/LumeWeb/libs5/compare/v0.1.0-develop.57...v0.1.0-develop.58) (2023-09-11)

4
npm-shrinkwrap.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.58", "version": "0.1.0-develop.59",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.58", "version": "0.1.0-develop.59",
"dependencies": { "dependencies": {
"@noble/curves": "^1.1.0", "@noble/curves": "^1.1.0",
"@noble/hashes": "^1.3.1", "@noble/hashes": "^1.3.1",

View File

@ -1,6 +1,6 @@
{ {
"name": "@lumeweb/libs5", "name": "@lumeweb/libs5",
"version": "0.1.0-develop.58", "version": "0.1.0-develop.59",
"type": "module", "type": "module",
"main": "lib/index.js", "main": "lib/index.js",
"repository": { "repository": {

View File

@ -42,6 +42,10 @@ export default class CID extends Multibase {
return CID._init(bytes); return CID._init(bytes);
} }
static fromRegistryPublicKey(pubkey: string | Uint8Array): CID {
return CID.fromHash(pubkey, 0, CID_TYPES.RESOLVER);
}
static fromHash( static fromHash(
bytes: string | Uint8Array, bytes: string | Uint8Array,
size: number, size: number,