Thanks to: http://unsplash.com/ http://foundation.zurb.com/ And Codepen :)
A Pen by Moncho Varela on CodePen.
var bitHex = 8; | |
//idea is that when a pub key gets created, the user stores this int32 in its profile. | |
//then when you go to fetch the list of pubkeys, hash the key and also fetch the int32 from the profile | |
//compair the alias + int32 and show the user profile(s) to the requesting user for decision | |
//when user has decided save the pubkey and any other meta data you wish | |
var sha256_toint_test = "something like a publickey that has a reference of the output int32"; |
SET TALK OFF | |
SET CURSOR OFF | |
SET SAFETY OFF | |
SET MEMOWIDTH TO 80 | |
CLEAR ALL | |
CLOSE ALL | |
CLEAR | |
CLEAR MACRO && Get rid of F keys typing commands | |
SET HELP OFF && Needed to clear out F1 key too |
/***************************************************************************** | |
* QuantCup 1: Price-Time Matching Engine | |
* | |
* Submitted by: voyager | |
* | |
* Design Overview: | |
* In this implementation, the limit order book is represented using | |
* a flat linear array (pricePoints), indexed by the numeric price value. | |
* Each entry in this array corresponds to a specific price point and holds | |
* an instance of struct pricePoint. This data structure maintains a list |
//=============================================== | |
// CLEAR GUN DATABASE | |
localStorage.clear(); | |
//(function() { | |
//=============================================== | |
// INIT GUN DATABASE | |
let gunurl = window.location.origin+'/gun'; | |
//console.log(gunurl); | |
var gun = Gun(gunurl); | |
gun.on('hi', peer => {//peer connect |
Thanks to: http://unsplash.com/ http://foundation.zurb.com/ And Codepen :)
A Pen by Moncho Varela on CodePen.
var crypto = require('crypto'); | |
var bitcoin = require('bitcoinjs-lib') | |
var bitcoinMessage = require('bitcoinjs-message') | |
function doVerify() { | |
var wif; |
const changePasswordWithPriv = this.changePasswordWithPriv = async (pub, priv, epriv, newPassword) => { | |
const id = `~${pub}` | |
const key = 'auth' | |
const salt = Gun.text.random(64) | |
const proof = await new Promise(res => SEA.work(newPassword, salt, res)) | |
const encrypted = await new Promise(res => SEA.encrypt({ priv, epriv }, proof, res, {raw: 1 })) | |
const value = JSON.stringify({ek: encrypted, s: salt}) | |
const signed = await SEA.sign( | |
{ | |
"#": id, |
import { createBrowserHistory } from 'history'; | |
const Gun = require('gun'); | |
const SEA = require('gun/sea'); | |
const history = createBrowserHistory({forceRefresh:true}); | |
var gun = Gun(); | |
var user = gun.user() | |
class Auth { | |
constructor() { |
var validator = module.exports = { | |
isDecimal : function(input) { return (/^(?=.)\d*(\.\d{1,9})?$/.test(input)); }, | |
isNull : function(input) { return ((input == null) || (typeof input === "string" && input.replace(/\s/g, "") == "") || (typeof input === "undefined") || (input.length == 0)); }, | |
isAlpha : function(input) { return (/^[a-zA-Z]+$/.test(input) && !validator.isNull(input)); }, | |
isAlphanumeric : function(input) { return !(/\WöäåÖÄÅ/.test(input)); }, | |
isNumeric : function(input) { return (/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/.test(input)); }, | |
isEmail : function(input) { return (!validator.isNull() || (/^(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]\.?){0,63}[a-z0-9!#$%&'*+\/=?^_`{|}~-]@(?:(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\])$/i).test(input)); } | |
}; |