Skip to content

Instantly share code, notes, and snippets.

View AdonousTech's full-sized avatar

Matt Pitts AdonousTech

  • Adonous Tech LLC
View GitHub Profile
@AdonousTech
AdonousTech / gist:31a2c38c89f7c9fcaefe230d9d37cb7b
Created April 23, 2022 04:02 — forked from jgornick/gist:3786127
JavaScript: Parse multiple JSON documents from string
/**
* Parses a string containing one or multiple JSON encoded objects in the string.
* The result is always an array of objects.
*
* @param {String} data
* @return {Array}
*/
function parseJson(data) {
data = data.replace('\n', '', 'g');
@AdonousTech
AdonousTech / signTxn.js
Created November 18, 2021 23:20 — forked from chafreaky/signTxn.js
DESO - Sign a transaction in nodejs given a seedHex and a txnHex
// Do `npm i elliptic sha256` before hand
const EC = require('elliptic').ec;
const sha256 = require('sha256');
function seedHexToPrivateKey(seedHex) {
const ec = new EC('secp256k1');
return ec.keyFromPrivate(seedHex);
}