JSLib Reference Manual / Exports / SBObjectHandle
Class: SBObjectHandle#
Basic object handle for a shard (all storage).
To RETRIEVE a shard, you need id and verification.
To DECRYPT a shard, you need key, iv, and salt. Current generation of shard servers will provide (iv, salt) upon request if (and only if) you have id and verification.
Note that id32/key32 are array32 encoded (a32). (Both id and key are 256-bit entities).
‘verification’ is a 64-bit integer, encoded as a string of up 23 characters: it is four 16-bit integers, either joined by ‘.’ or simply concatenated. Currently all four values are random, future generation only first three are guaranteed to be random, the fourth may be “designed”.
Implements#
Implemented by#
Table of contents#
Constructors#
Properties#
Accessors#
Constructors#
constructor#
• new SBObjectHandle(options)
Parameters#
Name |
Type |
|---|---|
|
Properties#
actualSize#
• Optional actualSize: number
optional: actual size of underlying file, if any
Implementation of#
SBObjectHandle.actualSize
dateAndTime#
• Optional dateAndTime: string
optional: time of shard creation
Implementation of#
SBObjectHandle.dateAndTime
fileName#
• Optional fileName: string
by convention will be “PAYLOAD” if it’s a set of objects
Implementation of#
SBObjectHandle.fileName
fileType#
• Optional fileType: string
optional: file type (mime)
Implementation of#
SBObjectHandle.fileType
iv#
• Optional iv: string | Uint8Array
you’ll need these in case you want to track an object across future (storage) servers, but as long as you are within the same SB servers you can request them.
Implementation of#
SBObjectHandle.iv
lastModified#
• Optional lastModified: number
optional: last modified time (of underlying file, if any)
Implementation of#
SBObjectHandle.lastModified
salt#
• Optional salt: string | Uint8Array
you’ll need these in case you want to track an object across future (storage) servers, but as long as you are within the same SB servers you can request them.
Implementation of#
SBObjectHandle.salt
savedSize#
• Optional savedSize: number
optional: size of shard (may be different from actualSize)
Implementation of#
SBObjectHandle.savedSize
version#
• Optional version: string = '1'
version of this object
Implementation of#
SBObjectHandle.version
Accessors#
id#
• get id(): string
id of object
Returns#
string
Implementation of#
SBObjectHandle.id
• set id(value): void
id of object
Parameters#
Name |
Type |
|---|---|
|
|
Returns#
void
Implementation of#
SBObjectHandle.id
id32#
• get id32(): Base62Encoded
optional: array32 format of id
Returns#
Base62Encoded
Implementation of#
SBObjectHandle.id32
• set id32(value): void
optional: array32 format of id
Parameters#
Name |
Type |
|---|---|
|
|
Returns#
void
Implementation of#
SBObjectHandle.id32
key#
• get key(): string
key of object
Returns#
string
Implementation of#
SBObjectHandle.key
• set key(value): void
key of object
Parameters#
Name |
Type |
|---|---|
|
|
Returns#
void
Implementation of#
SBObjectHandle.key
key32#
• get key32(): Base62Encoded
optional: array32 format of key
Returns#
Base62Encoded
Implementation of#
SBObjectHandle.key32
• set key32(value): void
optional: array32 format of key
Parameters#
Name |
Type |
|---|---|
|
|
Returns#
void
Implementation of#
SBObjectHandle.key32
type#
• get type(): SBObjectType
type of object
Returns#
Implementation of#
SBObjectHandle.type
verification#
• get verification(): string | Promise<string>
and currently you also need to keep track of this, but you can start sharing / communicating the object before it’s resolved: among other things it serves as a ‘write-through’ verification
Returns#
string | Promise<string>
Implementation of#
SBObjectHandle.verification
• set verification(value): void
and currently you also need to keep track of this, but you can start sharing / communicating the object before it’s resolved: among other things it serves as a ‘write-through’ verification
Parameters#
Name |
Type |
|---|---|
|
|
Returns#
void
Implementation of#
SBObjectHandle.verification