From d5dc1de41837088f7f6b47db22cfe8c4d1f1022c Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 3 Jan 2024 03:46:30 -0500 Subject: [PATCH] feat: initial byte types --- types/cid.go | 14 ++++++++++++++ types/hash.go | 8 ++++++++ types/registry.go | 8 ++++++++ 3 files changed, 30 insertions(+) create mode 100644 types/cid.go create mode 100644 types/hash.go create mode 100644 types/registry.go diff --git a/types/cid.go b/types/cid.go new file mode 100644 index 0000000..c407113 --- /dev/null +++ b/types/cid.go @@ -0,0 +1,14 @@ +package types + +type CIDType int + +const ( + CIDTypeRaw CIDType = 0x26 + CIDTypeMetadataMedia CIDType = 0xc5 + CIDTypeMetadataWebapp CIDType = 0x59 + CIDTypeResolver CIDType = 0x25 + CIDTypeUserIdentity CIDType = 0x77 + CIDTypeBridge CIDType = 0x3a + CIDTypeEncryptedStatic CIDType = 0xae + CIDTypeEncryptedDynamic CIDType = 0xad +) diff --git a/types/hash.go b/types/hash.go new file mode 100644 index 0000000..defa230 --- /dev/null +++ b/types/hash.go @@ -0,0 +1,8 @@ +package types + +type HashType int + +const ( + HashTypeBlake3 HashType = 0x1f + HashTypeEd25519 HashType = 0xed +) diff --git a/types/registry.go b/types/registry.go new file mode 100644 index 0000000..4a37343 --- /dev/null +++ b/types/registry.go @@ -0,0 +1,8 @@ +package types + +type RegistryType int + +const ( + RegistryTypeCID RegistryType = 0x5a + RegistryTypeEncryptedCID RegistryType = 0x5e +)