This file contains hidden or 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 JsSHA from 'jssha'; | |
| export default function getToken(key, period = 30, otp_length = 6) { | |
| let epoch, time, shaObj, hmac, offset, otp; | |
| key = base32tohex(key); | |
| epoch = Math.round(Date.now() / 1000.0); | |
| time = leftpad(dec2hex(Math.floor(epoch / period)), 16, '0'); | |
| shaObj = new JsSHA('SHA-1', 'HEX'); | |
| shaObj.setHMACKey(key, 'HEX'); | |
| shaObj.update(time); |
This file contains hidden or 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 JsSHA from 'jssha'; | |
| export default function getToken(key, period = 30, otp_length = 6) { | |
| let epoch, time, shaObj, hmac, offset, otp; | |
| key = base32tohex(key); | |
| epoch = Math.round(Date.now() / 1000.0); | |
| time = leftpad(dec2hex(Math.floor(epoch / period)), 16, '0'); | |
| shaObj = new JsSHA('SHA-1', 'HEX'); | |
| shaObj.setHMACKey(key, 'HEX'); | |
| shaObj.update(time); |
This file contains hidden or 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
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| Script para geolocalizar direcciones IP y generar tabla LaTeX usando GeoIP2 | |
| Uso: python3 geolocalize_ips.py < ips.txt | |
| Requiere: pip install geoip2 | |
| Descarga la base de datos GeoLite2-City.mmdb de MaxMind | |
| """ |
OlderNewer