Last active
December 11, 2019 14:45
-
-
Save victorcbr/bbef844e894326fb916fe2a0257d458d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// get | |
export const _getStorageValue = async (name, options) => { | |
let decript = options === 'decript'; | |
try { | |
const value = await AsyncStorage.getItem(name); | |
return decript ? Buffer.from(value, 'base64').toString('ascii') : value | |
} catch (error) { | |
console.log(error) | |
return error | |
} | |
} | |
// create storage | |
await AsyncStorage.setItem('@Clickpygg_login', new Buffer(JSON.stringify(data.result)).toString("base64")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment