About SASStore

I'm sure it bugs you every day when you run out of room because using 1s and 0s as strings in place of binary in Local Storage consumes too much space. Well, now SASStore (Sticks and Stones Store) can solve this pressing issue in your life! SASStore stores binary string data in the yEnc encoding format so that it will now be 7x (soon to be closer to 8x) fewer characters to store binary data than storing 1s and 0s as strings.

Examples

Below are some examples of how to use this crazy easy api and get started using Local Storage at its full potential.

var store = new SASStore({
    // Below are the default values for the store
    id: "testStore",
        // The id is the key to local storage.
        // When not specified, it will be a random 
        // 7 character string.
    chunkSize: 7,
        // The number of bits to use per character
        // no need to modify.
    length: 100,
        // Number of items to have in store.
    itemSize: 1
        // Number of bits per item.
});

// Gets item 5 in store.
store.getItem(5); -> "0"

// Sets item 5 in store to "1".
store.setItem(5, "1");

// Randomizes all bits in store.
store.randomize();

// Returns all items in store.
store.getAll(); -> ["0", "1", "0", ...]

// Counts all occurrences of an item value in store.
store.countOccurrencesOf("0"); -> 123

// Resets all bits to "0".
store.reset();

Demo

Location: Value:

Location:

Store Data:

Questions/Comments/Suggestions

If you have any input for this project or for me, please head over to the github page for this project or email me at dungfu3@gmail.com. Also, credit to whoughton for his yEnc javascript project that I used some code from.