Module: lib/protocol/codec

Module for Whiteflag message encoding and decoding

Source:
Tutorials:

Methods

(inner) decodeMessage(wfMessage, callback)

Decodes binary message to validated json object and updates metaheader accordingly

Parameters:
Name Type Description
wfMessage wfMessage

Whiteflag message with encoded message string in MetaHeader

callback decodeMessageCb

function called on completion

Source:

(inner) encodeMessage(wfMessage, callback)

Encodes a json formatted message to binary format and updates metaheader accordingly

Parameters:
Name Type Description
wfMessage wfMessage

a Whiteflag message

callback wfMessageCb

function called on completion

Source:

(inner) verifyFormat(wfMessage, callback)

Checks if message formate validates against schema and updates metaheader accordingly

Parameters:
Name Type Description
wfMessage wfMessage

a Whiteflag message

callback wfMessageCb

function called on completion

Source:

Type Definitions

decodeMessageCb(err, message, ivMissing)

Parameters:
Name Type Description
err Error

any error

message wfMessage

the Whiteflag message

ivMissing boolean

true if iv is missing else false

Source: