mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 06:54:58 +00:00
Update lib/punycode.js, lib/totp.js
This commit is contained in:
parent
f00e6eed1e
commit
2ba05aa633
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user