-
-
Notifications
You must be signed in to change notification settings - Fork 16
.safeset
localDataStorage.safeset( keyName, value, [user scramble key] )
This method stores value under keyName, creating a new key if necessary, where the key prefix is prepended to keyName, and value is stored obfuscated. A user scramble key is optional, and if omitted, the global scramble key will be used.
This will overwrite an existing value for keyName. When this happens, the prior value cannot be retrieved.
While value is obscured, it is not encrypted. This means, for example, that value is not padded to a certain amount to disguise its true length.
Scramble keys (user or global) may be set to any data type, just the same as value.
The value of the updated keyName is returned when this method executes.
EXAMPLES:
- localData.safeset( 'safeKey1', 'obfuscated data here', [123456] )
- localData.safeset( 'safeKey2', 99.97, 'my secret scramble key' )
- localData.safeset( 'safeKey3', new Date(), 6977221 )
- localData.safeset( 'safeKey4', true, {'a':['1']} )
🌐 This method may fire an event allowing you to monitor the key change.
✨ The complement to this is safeget.
🏿 The corresponding Memory Key method is _safeset.
📝 NOTE: To examine the obsfuscated data internally, retrieve keyName using forceget.
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