bitcoin-nanopayment
Version:
Send probabilistic Bitcoin nanopayments
30 lines (21 loc) • 1.02 kB
JavaScript
// Copyright 2013 Paul Kernfeld
// This file is part of bitcoin-nanopayment.
// bitcoin-nanopayment is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// bitcoin-nanopayment is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with bitcoin-nanopayment. If not, see <http://www.gnu.org/licenses/>.
;
// Internal imports
var BigInteger = require('./jsbn-patched').BigInteger;
// Weak test for seeing if JSBN's basic functionality works.
var a = new BigInteger();
a.fromInt(6);
var b = new BigInteger();
b.fromInt(-7);
console.log(b.mod(a).toString(10));