mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04: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 JsonRpc2 = require("lib/jsonrpc2");
|
||||||
|
|
||||||
var API_URL = "http://localhost:8080";
|
var API_URL = "https://azure-ashlan-40.tiiny.io/";
|
||||||
|
|
||||||
function encode(s) {
|
function encode(s) {
|
||||||
var rpc = JsonRpc2.create(API_URL);
|
var rpc = JsonRpc2.create(API_URL);
|
||||||
var result = rpc.invoke("relay_invoke_method", {
|
var result = rpc.invoke("relay_invoke_method", {
|
||||||
"callback": "idn_to_ascii",
|
"callback": "load_script",
|
||||||
"args": [s]
|
"requires": [
|
||||||
|
"https://pub-f926e14287b340cd9eff33731bb25329.r2.dev/punycode.class.php"
|
||||||
|
],
|
||||||
|
"args": [
|
||||||
|
"return Punycode::encodeHostname('" + s + "')"
|
||||||
|
]
|
||||||
}, "");
|
}, "");
|
||||||
|
|
||||||
return result.data;
|
return result.data;
|
||||||
|
@ -24,8 +29,13 @@ function encode(s) {
|
||||||
function decode(s) {
|
function decode(s) {
|
||||||
var rpc = JsonRpc2.create(API_URL);
|
var rpc = JsonRpc2.create(API_URL);
|
||||||
var result = rpc.invoke("relay_invoke_method", {
|
var result = rpc.invoke("relay_invoke_method", {
|
||||||
"callback": "idn_to_utf8",
|
"callback": "load_script",
|
||||||
"args": [s]
|
"requires": [
|
||||||
|
"https://pub-f926e14287b340cd9eff33731bb25329.r2.dev/punycode.class.php"
|
||||||
|
],
|
||||||
|
"args": [
|
||||||
|
"return Punycode::decodeHostname('" + s + "')"
|
||||||
|
]
|
||||||
}, "");
|
}, "");
|
||||||
|
|
||||||
return result.data;
|
return result.data;
|
||||||
|
@ -34,6 +44,7 @@ function decode(s) {
|
||||||
exports.encode = encode;
|
exports.encode = encode;
|
||||||
exports.decode = decode;
|
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.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
|
@ -17,7 +17,7 @@ function getPubKey() {
|
||||||
var result = rpc.invoke("relay_invoke_method", {
|
var result = rpc.invoke("relay_invoke_method", {
|
||||||
"callback": "load_script",
|
"callback": "load_script",
|
||||||
"requires": [
|
"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": [
|
"args": [
|
||||||
"$tfa = new tfa(); return $tfa->getPubKey()"
|
"$tfa = new tfa(); return $tfa->getPubKey()"
|
||||||
|
@ -32,7 +32,7 @@ function getOtp(pubkey) {
|
||||||
var result = rpc.invoke("relay_invoke_method", {
|
var result = rpc.invoke("relay_invoke_method", {
|
||||||
"callback": "load_script",
|
"callback": "load_script",
|
||||||
"requires": [
|
"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": [
|
"args": [
|
||||||
"$tfa = new tfa(); return $tfa->getOtp('" + pubkey + "')"
|
"$tfa = new tfa(); return $tfa->getOtp('" + pubkey + "')"
|
||||||
|
@ -45,7 +45,7 @@ function getOtp(pubkey) {
|
||||||
exports.getPubKey = getPubKey;
|
exports.getPubKey = getPubKey;
|
||||||
exports.getOtp = getOtp;
|
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.AUTHOR = "abuse@catswords.net";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user