                       | ((hash[offset + 1] & 0xff) << 16)
                       | ((hash[offset + 2] & 0xff) << 8)
                       | ((hash[offset + 3] & 0xff));
-  Serial.println("thinged");
-  Serial.println(thing);
   
   for (int i = TOKEN_LENGTH - 1; i >= 0; i--) {
     token[i] = (thing % 10) + '0';
     thing /= 10;
   }
-  
-  Serial.println("\ndone");
 } 
 
 void setup() {

  return count;
}

void totp(const uint8_t* key, const size_t len, const long time, char token[TOKEN_LENGTH]) {
  Serial.println("Starting totp");
  long tc = time / INTERVAL;
  Sha1.initHmac(key, len);
  Serial.println("inited Hmac");
  Sha1.write((uint8_t) (tc >> 24));
  Sha1.write((uint8_t) (tc >> 16));
  Sha1.write((uint8_t) (tc >> 8));
  Sha1.write((uint8_t) tc);
 


  
  Serial.println("wrote");
  uint8_t *hash = Sha1.resultHmac();
  
  Serial.println("hashed");
  
  uint8_t offset = hash[19] & 0xf;
  

  Serial.begin(115200);
  rtc.begin();
  
  uint8_t keyBase32[33];
  String("salvdaxi3ipetshmxf54muq7q4k3cnrj").toCharArray((char *)keyBase32, 33);
  
  uint8_t key[20];
  base32_decode(keyBase32, key, 20);
  
  uint8_t correctKey[20] = { 0x90, 0x17, 0x51, 0x82, 0xe8, 0xda, 0x1e, 0x49, 0xc8, 0xec, 0xb9, 0x7b, 0xc6, 0x52, 0x1f, 0x87, 0x15, 0xb1, 0x36, 0x29 };
  
  char token[TOKEN_LENGTH];
  
  totp(correctKey, 20, getTimestamp(), token);
  
  Serial.println(token);

}

