top

CAPH.DAL.BASECACHE

BaseCache is a class that is a parent class of LocalStorageCache. Furthermore, it will be the base class when a user extend data cache functionality and create a new cache class. Also, BaseCache provides a utility function. Its name is encodeUInt8ArrayToBase64, which encodes a Uint8 TypedArray to a base64 string.


Constructor

BaseCache

Description
construct a BaseCache
Emulator SupportY
SDK ConstraintNone
Example
var BaseCache = caph.dal.BaseCache;
var basecache = new BaseCache(); // Use Constructor

Methods

encodeUInt8ArrayToBase64

Description
Encode a Uint8 TypedArray to a base64 string
Parameters
■input
  - Uint8 TypedArray
  - A Uint8 TypedArray as an input.
  - [default : null]
Return■String
  - A base64-encoded string
Emulator SupportY
SDK Constraintnone
Example
var BaseCache = caph.dal.BaseCache;
var basecache = new BaseCache();

// Let's say data  - - binary is given
var uInt8Array = new Uint8Array(binary);
var binaryData = basecache.encodeUInt8ArrayToBase64(uInt8Array);

BaseCache

Description
(Constructor) construct a BaseCache
Parameters
■Void
Return■BaseCache
  - An instance of BaseCache
Emulator SupportY
SDK Constraintnone
Example
var BaseCache = caph.dal.BaseCache;
var basecache = new BaseCache(); // Use Constructor