@aldea/sdk / Exports / Pointer
Class: Pointer
Aldea Pointer
A consists of a 32 byte ID and an index integer which points to the location of an object within a larger data structure.
A Pointer is encoded as a string by concatentating the hex encoded ID with the index.
Example:
3b2af88dad7f1847f5b333852b71ac6fd2ae519ba2d359e8ce07b071aad30e80_1
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new Pointer(id
, idx
): Pointer
Parameters
Name | Type |
---|---|
id | string | Uint8Array |
idx | number |
Returns
Defined in
packages/core/dist/pointer.d.ts:18
Properties
idBuf
• idBuf: Uint8Array
Defined in
packages/core/dist/pointer.d.ts:16
idx
• idx: number
Defined in
packages/core/dist/pointer.d.ts:17
Accessors
id
• get
id(): string
Returns
string
Defined in
packages/core/dist/pointer.d.ts:21
Methods
equals
▸ equals(ptr
): boolean
Parameters
Name | Type |
---|---|
ptr | Pointer |
Returns
boolean
Defined in
packages/core/dist/pointer.d.ts:22
toBytes
▸ toBytes(): Uint8Array
Returns
Uint8Array
Defined in
packages/core/dist/pointer.d.ts:23
toString
▸ toString(): string
Returns
string
Defined in
packages/core/dist/pointer.d.ts:24
fromBytes
▸ fromBytes(bytes
): Pointer
Parameters
Name | Type |
---|---|
bytes | Uint8Array |
Returns
Defined in
packages/core/dist/pointer.d.ts:19
fromString
▸ fromString(str
): Pointer
Parameters
Name | Type |
---|---|
str | string |
Returns
Defined in
packages/core/dist/pointer.d.ts:20