Record Replay Protocol

Methods

Resource.create

Upload a file, and for ease of use, get a resource proof for it.

parameters
content
string

The content you wish to upload.

Return Object
resource
Proof

Proof that can be passed back to the server to reference this asset.

Resource.exists

Check if a given resource already exists on our servers.

parameters
resource
Proof
Return Object
exists
boolean

Resource.token

Get the token to use when computing the hashes of a given file.

parameters
hash
FileHash

The file's unsalted hash.

Return Object
token
Token

The token to use to create a proof for this file.

expiration
number

The unixtime when the token will be invalidated, in seconds.

Types

Resource.FileHash

A string representing hashed resource file content.

All hashes should be computed with SHA256 and prefixed with "sha256:" All hashes should be computed using the UTF8 encoding of their content. All hashes should be encoded as hex.

Type: string

Resource.Proof

An object representing knowledge of a file's full content.

Type: object

properties
token
Token
saltedHash
FileHash

Resource.Token

An opaque salt value that can be used to create a Proof for a file.

This string should be prepended to the file's content when calculating the file's salted hash for the Proof.

Type: string