This file contains 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
// C# version -> https://gist.github.com/dehghani-mehdi/2af3d913786d8b1b286f9c28cc75d5f4 | |
var isValidNationalCode = function(code) { | |
if (code.length !== 10 || /(\d)(\1){9}/.test(code)) return false; | |
var sum = 0, | |
chars = code.split(''), | |
lastDigit, | |
remainder; |
This file contains 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
import { AsyncStorage } from 'react-native' | |
import { setGenericPassword, getGenericPassword, resetGenericPassword } from 'react-native-keychain' | |
export default { | |
async getAllKeys (callback) { | |
try { | |
const keys = await AsyncStorage.getAllKeys() | |
if (callback) { | |
callback(null, keys) | |
} |