https://newcodingera.com/datatables-server-side-processing-using-nodejs-mysql/
https://1drv.ms/u/s!At2KEcnT9DVaiw88MAEXeML0bRf3
Important! SqlInjection ======================
datatables mongodb
https://github.com/deepikagunda/datatables
https://medium.com/@antonassocareer/web3-secp256k1-%E7%B0%BD%E7%AB%A0%E8%88%87solidity%E9%A9%97%E7%AB%A0-26ded518cfdc
那麼如果我們想要單純用私鑰簽章一段資料,不要有Ethereum定義的那些prefix的話,就必須要直接調用 secp256k1 這一包library了。不過在用之前要知道,所有要丟給secp256k1簽章的message,長度都必須是256 bits,也就是32 bytes。剛剛我們說web3的簽名函式丟什麼都可以,是因為它會幫我加上prefix之後再做sha3 Hash (keccak),最後一定會變成一個32 bytes的東西。如果我們自己純靠私要簽章訊息的話,也勢必要先通過這個函式來整理input長度
sha3 Hash (keccak)
const bip39 = require('bip39') const bip32 = require('bip32'); const EC = require('elliptic').ec; json =`test json file` mnemonic = "簡 熙 夢 幾 聲 可 高 汪 煙 版 統 仇" path = "m/2018'/5'/1'/0/1" const sJWSinit = async () => { console.log('-----sJWS Initial Start----- \n'); dkey = await DeriveKey(mnemonic, path) console.log("\nGet dkey: %o \n", dkey) console.log('\n-----elliptic ed25519 Start----- \n'); var EdDSA = require('elliptic').eddsa var ec = new EdDSA('ed25519'); var eckeypair = ec.
bitcoinSecp256r1.HDNode.fromSeedBuffer 無法使用,目前正確應該是用 bitcoinSecp256r1.bip32.fromSeed
jsrsasign 有異常
const bip39 = require('bip39') const bip32 = require('bip32'); const bitcoinSecp256r1 = require('bitcoinjs-lib') const ethUtil = require('ethereumjs-util') const EC = require('elliptic').ec; // bitcoinSecp256r1.HDNode.fromSeedBuffer 無法使用,目前正確應該是用 bitcoinSecp256r1.bip32.fromSeed mnemonic = "簡 熙 夢 幾 聲 可 高 汪 煙 版 統 仇" path = "m/2018'/5'/1'/0/1" type = "secp256r1" // 驗證網頁 https://iancoleman.io/bip39/#chinese_traditional if (bip39.validateMnemonic(mnemonic)) { console.log("mnemonic is fake!") } const seed = bip39.mnemonicToSeed(mnemonic).then((vseed)=>{ var root = bip32.fromSeed(vseed) var PathNode = root.
HDWalletProvider engine.stop() p = HDWalletProvider(MNEMONIC_SYSTEM, "http://ganache:8545", 0); p.engine.stop(); HDWalletProvider engine.stop() and pool export function GetHdProvider(id: number, rpcurl: string) { //return new HDWalletProvider(MNEMONIC_SYSTEM, url, id); return id==0?Provider1Pool.acquire():Provider2Pool.acquire(); } // Normal use const hdProvider0 = await GetHdProvider(0, providerUrl).then(function(client) {return client}).catch(function(err) {throw new HttpException(err.toString(), HttpStatus.BAD_REQUEST);}); const hdProvider1 = await GetHdProvider(1, providerUrl).then(function(client) {return client}).catch(function(err) {throw new HttpException(err.toString(), HttpStatus.BAD_REQUEST);}); // Normal release ReleaseHDProvider1(hdProvider1 ); // Pool code const genericPool = require("generic-pool"); const opts = { max: 10, // maximum size of the pool min: 2, // minimum size of the pool idleTimeoutMillis: 30000, log: true }; const factory0 = { // maybe different parms create: function() { return new HDWalletProvider(MNEMONIC_SYSTEM, RPCURL, 0); }, destroy: function(client) { client.
https://codeforgeek.com/server-side-pagination-using-node-and-mongo/
const https = require('https'); export async function GetUserinfo(Token) { console.log(process.env["NODE_TLS_REJECT_UNAUTHORIZED"]) process.env["NODE_TLS_REJECT_UNAUTHORIZED"] = 0; console.log(process.env["NODE_TLS_REJECT_UNAUTHORIZED"]) const baseURL = 'https://openid.hydra:9001'; const userinfoURL = '/userinfo'; axios({ method: 'get', headers: { 'Authorization': 'Bearer ' + Token, 'accept': 'application/json' }, httpsAgent: new https.Agent({ rejectUnauthorized: false, ecdhCurve: 'auto' }), url: userinfoURL, baseURL: baseURL, responseType: 'json' }).then(function (response) { process.env[“NODE_TLS_REJECT_UNAUTHORIZED”] = 0; No Need, No mean
Error: self signed certificate Answer: rejectUnauthorized: false,
HTTPs requests to API fail: ‘sslv3 alert handshake failure Answer: ecdhCurve: ‘auto’