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
/** | |
* nodeでAWSとかのTOTP方式のMFAを利用するやつ。 | |
* | |
* node-zxingはJavaのクラスパスが:で区切られてるのでそのままだとWindowsでは使えず | |
* thirty-twoはVer0.02じゃないと失敗する場合がある | |
*/ | |
var qr = require('node-zxing')(); | |
var notp = require('notp'); | |
var base32 = require('thirty-two'); |
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
var five = new require('johnny-five'); | |
var RTC = 0x68; | |
var board = new five.Board(); | |
board.on("ready", function() { | |
board.io.sendI2CConfig(0); | |
setTime(); | |
setInterval(getTime,1000); | |
}); | |
function fromBcd(num){ |