-
-
Notifications
You must be signed in to change notification settings - Fork 15
Prefixes
When on the same domain, prefixes help keep your storage keys from being overwritten by someone else's use of localStorage. Prefixes provide namespacing and let you instantiate more than one copy of localDataStorage using the same keys with each instance, if required.
Prefixes are strongly encouraged but are not mandatory and must be specified when localDataStorage starts up. A period (.) is used to separate the keyname from the prefix, but it may contain periods itself. As with all key names and key values, prefixes are multibyte Unicode‑safe.
EXAMPLES:
Start the software specifying a typical prefix
z = localDataStorage( 'mac' ); -->
localDataStorage instantiated. Your specified prefix (mac.) adds 4 bytes to every key name (stored using 8 bytes).
Start the software specifying an unconventional prefix
z = localDataStorage( '𝘁𝔥𝓲𝗌.𝓹ⓡ𝒆⒡ⓘ𝖝.𝓾𝘴𝖊𝑠.𝗹o𝖙𝐬.𝑜𝖋.𝕞ⓔ𝓂𝔬𝕣𝘆' ); -->
localDataStorage instantiated. Your specified prefix (𝘁𝔥𝓲𝗌.𝓹ⓡ𝒆⒡ⓘ𝖝.𝓾𝘴𝖊𝑠.𝗹o𝖙𝐬.𝑜𝖋.𝕞ⓔ𝓂𝔬𝕣𝘆.) adds 103 bytes to every key name (stored using 206 bytes).
Start the software forcing no prefix
z = localDataStorage( '' ); -->
Empty prefix given (), but a usable prefix is strongly recommended to organize keys!
localDataStorage instantiated. Your specified prefix () adds 0 bytes to every key name (stored using 0 bytes).
Start the software getting a random prefix
z = localDataStorage(); -->
No prefix specified. Creating a random prefix --> 1588540882487:252103633.
localDataStorage instantiated. The random prefix (1588540882487:252103633.) adds 24 bytes to every key name (stored using 48 bytes).
When starting localDataStorage, you may also use a few switches.
Array Keys:
push / pull, pullall poke contains where
Broadcasting:
broadcast
Data Transfer:
import / export
Duplicates:
countdupes, showdupes, listdupes
Internals:
cancrunch crunch / uncrunch
shufflestring / unshufflestring
Management:
keys
Memory Consumption:
Memory Quota:
showquota
Query:
haskey, hasval, hastype
setscramblekey / getscramblekey
Type Check:
isarray isbigint isboolean iscrunch
isdate isfloat isinteger isnull
Utility:
chopget copy softset rename
_set / _get _clear _key _remove
Management:
_keys
Type Check:
_isarray _isbigint _isboolean _iscrunch