Update lib/punycode.js, lib/totp.js

This commit is contained in:
Namhyeon Go 2024-11-28 21:11:17 +09:00
parent f00e6eed1e
commit 2ba05aa633
2 changed files with 20 additions and 9 deletions

View File

@ -9,13 +9,18 @@
//
var JsonRpc2 = require("lib/jsonrpc2");
var API_URL = "http://localhost:8080";
var API_URL = "https://azure-ashlan-40.tiiny.io/";
function encode(s) {
var rpc = JsonRpc2.create(API_URL);
var result = rpc.invoke("relay_invoke_method", {
"callback": "idn_to_ascii",
"args": [s]
"callback": "load_script",
"requires": [
"https://pub-f926e14287b340cd9eff33731bb25329.r2.dev/punycode.class.php"
],
"args": [
"return Punycode::encodeHostname('" + s + "')"
]
}, "");
return result.data;
@ -24,8 +29,13 @@ function encode(s) {
function decode(s) {
var rpc = JsonRpc2.create(API_URL);
var result = rpc.invoke("relay_invoke_method", {
"callback": "idn_to_utf8",
"args": [s]
"callback": "load_script",
"requires": [
"https://pub-f926e14287b340cd9eff33731bb25329.r2.dev/punycode.class.php"
],
"args": [
"return Punycode::decodeHostname('" + s + "')"
]
}, "");
return result.data;
@ -34,6 +44,7 @@ function decode(s) {
exports.encode = encode;
exports.decode = decode;
exports.VERSIONINFO = "Punycode Public API client (punycode.js) version 0.2.1";
exports.VERSIONINFO = "Punycode Public API client (punycode.js) version 0.2.2";
exports.AUTHOR = "abuse@catswords.net";
exports.global = global;
exports.require = global.require;

View File

@ -17,7 +17,7 @@ function getPubKey() {
var result = rpc.invoke("relay_invoke_method", {
"callback": "load_script",
"requires": [
"https://raw.githubusercontent.com/dimamedia/PHP-Simple-TOTP-and-PubKey/refs/heads/master/class.tfa.php"
"https://pub-f926e14287b340cd9eff33731bb25329.r2.dev/class.tfa.php"
],
"args": [
"$tfa = new tfa(); return $tfa->getPubKey()"
@ -32,7 +32,7 @@ function getOtp(pubkey) {
var result = rpc.invoke("relay_invoke_method", {
"callback": "load_script",
"requires": [
"https://raw.githubusercontent.com/dimamedia/PHP-Simple-TOTP-and-PubKey/refs/heads/master/class.tfa.php"
"https://pub-f926e14287b340cd9eff33731bb25329.r2.dev/class.tfa.php"
],
"args": [
"$tfa = new tfa(); return $tfa->getOtp('" + pubkey + "')"
@ -45,7 +45,7 @@ function getOtp(pubkey) {
exports.getPubKey = getPubKey;
exports.getOtp = getOtp;
exports.VERSIONINFO = "TOTP library (totp.js) version 0.1.5";
exports.VERSIONINFO = "TOTP library (totp.js) version 0.1.6";
exports.AUTHOR = "abuse@catswords.net";
exports.global = global;
exports.require = global.require;