I hereby claim:
- I am ushuz on github.
- I am ushuz (https://keybase.io/ushuz) on keybase.
- I have a public key ASDlg-6JYDTg5j9xPkeoQ4wNAh5AwioNc3MPunJPEikO_Qo
To claim this, I am signing this object:
// Minimal TOTP implementation based on Web Crypto API that runs in browser, based on: | |
// https://www.laroberto.com/totp-primer/ | |
// https://github.com/BYossarian/base-desires/blob/601fb587bbc495e299a4f24b78d5ca101c7db2ce/index.js#L98-L149 | |
const computeHOTP = async (secret, counter) => { | |
// https://tools.ietf.org/html/rfc4226#section-5.1 | |
const formatCounter = (counter) => { | |
const binStr = ('0'.repeat(64) + counter.toString(2)).slice(-64); | |
let intArr = []; | |
for (let i = 0; i < 8; i++) { |
# view gloabl prefs in json | |
# plutil -convert json -o - -- /Library/Preferences/.GlobalPreferences.plist | python -m json.tool | |
import CoreFoundation as cf | |
# get current Country | |
cf.CFPreferencesCopyValue('Country', cf.kCFPreferencesAnyApplication, cf.kCFPreferencesAnyUser, cf.kCFPreferencesAnyHost) | |
# set Country | |
cf.CFPreferencesSetValue('Country', 'TW', cf.kCFPreferencesAnyApplication, cf.kCFPreferencesAnyUser, cf.kCFPreferencesAnyHost) |
I hereby claim:
To claim this, I am signing this object: