Skip to content

Instantly share code, notes, and snippets.

@RaresAil
RaresAil / yubico-otp.js
Last active October 13, 2022 20:51
Yubico OTP Verification with No Cloud
const crypto = require('crypto');
const MAX_TIMESTAMP = 0xffffff;
const MAX_SESSION_CTR = 0xff;
const MAX_USE_CTR = 0x7fff;
class Token {
#privateId = null;
#secretKey = null;
#publicId = null;
@RaresAil
RaresAil / nfc-lock-accessory.ts
Last active September 30, 2023 21:47
NFC Access Homebridge Minimal example
// After the example from https://github.com/KhaosT/HAP-NodeJS/commit/80cdb1535f5bee874cc06657ef283ee91f258815
import { Service } from 'homebridge';
import Platform, { DevicePlatformAccessory } from '../../platform';
import Accessory from '../../types/Accessory';
export default class NFCDoorAccessory implements Accessory {
private get Characteristic() {
return this.platform.Characteristic;