Class: SalmonHeader

SalmonHeader()

Header embedded in the SalmonStream. Header contains nonce and other information for decrypting the stream.

Constructor

new SalmonHeader()

Source:

Classes

SalmonHeader

Methods

getChunkSize() → {number}

Get the chunk size.
Source:
Returns:
Chunk size
Type
number

getHeaderData() → {Uint8Array|null}

Get the raw header data.
Source:
Returns:
Header data
Type
Uint8Array | null

getMagicBytes() → {Uint8Array}

Get the magic bytes
Source:
Returns:
Magic bytes
Type
Uint8Array

getNonce() → {Uint8Array|null}

Get the nonce.
Source:
Returns:
The nonce saved in the header.
Type
Uint8Array | null

getVersion() → {number}

Get the Salmon format version
Source:
Returns:
The format version
Type
number

setChunkSize(chunkSize)

Set the header chunk size
Parameters:
Name Type Description
chunkSize number The chunk size
Source:

setNonce(nonce)

Set the nonce to be used.
Parameters:
Name Type Description
nonce Uint8Array The nonce
Source:

setVersion(version)

Set the Salmon format version
Parameters:
Name Type Description
version number The format version
Source:

(async, static) parseHeaderData(stream) → {Promise.<SalmonHeader>}

Parse the header data from the stream
Parameters:
Name Type Description
stream RandomAccessStream The stream.
Source:
Throws:
IOException Thrown if there is an IO error.
Returns:
The header
Type
Promise.<SalmonHeader>