This file contains 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
const { randomBytes } = require('crypto') | |
const secp256k1 = require('secp256k1') | |
// or require('secp256k1/elliptic') | |
// if you want to use pure js implementation in node | |
// generate message to sign | |
const msg = randomBytes(32) | |
// generate privKey | |
let privKey |

This file contains 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
{"lastUpload":"2020-01-10T14:41:13.416Z","extensionVersion":"v3.4.3"} |
This file contains 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
const { randomBytes } = require('crypto') | |
const secp256k1 = require('secp256k1') | |
const createKeccakHash = require('keccak') | |
const signToPubAddress = (msghash, sig) => { | |
// TODO: verify msghash and sig | |
const v = Number(sig.slice(128)); | |
const sigObj = {r: sig.slice(0, 64), s: sig.slice(64, 128)}; | |
const point = secp256k1.recoverPubKey(msghash, sigObj, v); | |
const pub = point.encode('hex'); |
This file contains 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
#!/bin/sh | |
# Flora Listening by LeaskH.com | |
initFlora() { | |
export PATH=~/Documents/.flora:$PATH | |
} | |
getLastListening() { | |
echo `cat /tmp/flora_listening 2> /dev/null` | |
} |
This file contains 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
let a = [ | |
[1, 2, 3, 4], | |
[1, 2, 3, 4], | |
[1, 2, 3, 4], | |
[1, 2, 3, 4], | |
]; | |
let t1 = new Date().getTime(); |
This file contains 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
array = []; | |
with open('test.txt', 'r') as f: | |
while True: | |
line = f.readline().strip() | |
if not line: | |
break | |
line = list(map(int, line.split(' '))) | |
array.append(line) |
This file contains 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
var net = require('net'); | |
var HOST = '127.0.0.1'; | |
var PORT = 8977; | |
var client = new net.Socket(); | |
client.connect(PORT, HOST, function() { | |
console.log('connect'); | |
client.write('data'); | |
client.write('data'); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
var fakeAjax = function(url, success, fail) { | |
setTimeout(function() { | |
console.log('Done!!!'); | |
success(); | |
}, 1000); | |
}; | |
var render = function() { | |
$('.cloud-Label ul.clearFix').append('<li>anything</li>'); | |
}; |