This module provides converters to and from ArrayBuffer objects.
ArrayBuffer
Converters are commonly used as kv.typedKv or kv.typedKvSet arguments. Another use case is crypto.wrapKey to convert PEM-encoded keys to ArrayBuffer.
kv.typedKv
kv.typedKvSet
crypto.wrapKey
Example:
import * as ccfapp from '@microsoft/ccf-app';const val = 'my-string';const buf = ccfapp.string.encode(val); // ArrayBufferconst val2 = ccfapp.string.decode(buf); // string, val == val2 Copy
import * as ccfapp from '@microsoft/ccf-app';const val = 'my-string';const buf = ccfapp.string.encode(val); // ArrayBufferconst val2 = ccfapp.string.decode(buf); // string, val == val2
This module provides converters to and from
ArrayBuffer
objects.Converters are commonly used as
kv.typedKv
orkv.typedKvSet
arguments. Another use case iscrypto.wrapKey
to convert PEM-encoded keys toArrayBuffer
.Example: