Skip to content

Instantly share code, notes, and snippets.

@nssy
nssy / pow_to_diff.js
Last active March 1, 2019 11:09
Check difficulty from pow hash (Monero v8)
/*
node depanancies:
npm install bignum
*/
var bignum = require('bignum');
var diff1 = bignum('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF', 16);
// This is what miner submits
var powHash;
@nssy
nssy / hash-creator.php
Last active August 29, 2015 14:03
Hash Creator (PHP)
<?php
$string = isset($_POST['string']) ? $_POST['string'] : null;
$selected_algo = isset($_POST['algo']) ? $_POST['algo'] : null;
if (!empty($string) && !empty($selected_algo ))
{
if (in_array($selected_algo, hash_algos())) {
echo 'The ',$selected_algo, ' for ( <b>', $string, '</b> ) is => ', hash($selected_algo, $string, false);
} else {