Skip to content

._safeget

W. ❝Mac❞ McMeans edited this page Dec 25, 2023 · 1 revision

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

This method restores the obfuscated value stored under keyName returning the original value and data type. (If an Object was stored then an Object 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._safeset( 'safeMemKey1', 123456 )   -->   'my obfuscated data'
  • localData._safeset( 'safeMemKey2', 'my secret scramble key' )   -->   .007
  • localData._safeset( 'safeMemKey3', 'BR549' )   -->   Sun Oct 24 2022 19:34:31 GMT-0500 (Eastern Standard Time)
  • localData._safeset( 'safeMemKey4', {'z':['10']} )   -->   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.

🛢 The corresponding disk-based method is safeget.

📝 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