1.1.5 • Published 3 years ago
bytestorage v1.1.5
ByteStorage
A byte based storage
To get started first create a ByteStorage class
const ByteStorage = require('bytestorage');
var Storage = new ByteStorage('datafile.dat');
Get length of data:
Storage.lengthOfData(); // Returns an int
Get length of array
Storage.lengthOfArray(index); // Returns an int
Get data in array
Storage.getDataFromArray(array, index) // Returns bytes, use stringify to get text
Stringify data
Storage.stringify(data); // Stringify data
Get file contents
Storage.getFileData(); // Returns bytes
Add to array
Storage.addToArray('string', array); // Returns nothing
Update 1.1.5: Change 66 to 89 because 66 is the ascii character 'f'