Skip to content

.safeget

W. ❝Mac❞ McMeans edited this page Dec 24, 2023 · 10 revisions

localDataStorage.safeget( keyName, [user scramble key] )

This method restores the obfuscated value stored under keyName returning the original value and data type. (If an Array was stored then an Array would be returned.) A user scramble key is optional, but if one were used to safeset the key, it must be supplied in order to retrieve the original value. When omitted, the global scramble key will be transparently used.

EXAMPLES:

● localData.safeget( 'safeKey1', [123456] )   -->   'obfuscated data here'
● localData.safeget( 'safeKey2', 'my secret scramble key' )   -->   99.97
● localData.safeget( 'safeKey3', 6977221 )   -->   Fri May 19 2017 10:04:17 GMT-0400 (Eastern Daylight Time)
● localData.safeget( 'safeKey4', {'a':['1']} )   -->   true

Obviously, if you call safeget on an obfuscated key and supply the wrong scramble key then the returned value will be incorrect.

✨ The complement to this is safeset.

📝 NOTE: There is nothing to prevent you from safesetting a key and then, inadvertently or otherwise, retrieving the value with a method other than safeget. For instance, calling get on a key that was created using safeset will simply return the obfuscated value (not the original protected value).

localStorage Keys

The usual suspects:

set / get      clear      key      remove

The esoteric ones:

Array Keys:
push / pull, pullall      poke      contains      where

Broadcasting:
broadcast

Bypass:
forceset / forceget

Data Transfer:
import / export

Duplicates:
countdupes, showdupes, listdupes

Internals:
cancrunch      crunch / uncrunch

shufflestring / unshufflestring

xorstring

Management:
keys

Memory Consumption:

Memory Quota:
showquota

Query:
haskey, hasval, hastype

Security:
safeset / safeget

setscramblekey / getscramblekey

Type Check:
isarray      isbigint      isboolean      iscrunch

isdate      isfloat      isinteger      isnull

isnumber      isobject      isstring

showtype

Utility:
chopget      copy      softset      rename

Properties:

channel      length      quota      version

Settings:

verbosity

Memory Keys

Standard:

_set / _get      _clear      _key      _remove

Unconventional:

Data Sync:
_backup / _restore

Management:
_keys

Security:
_safeset / _safeget

Type Check:
_isarray      _isbigint      _isboolean      _iscrunch

_isdate      _isfloat      _isinteger      _isnull

_isnumber      _isobject      _isstring

_showtype

Utility:
_chopget      _copy      _softset      _rename

Clone this wiki locally