Comments (7)
Another bug:
coinjs.numToBytes = function(num,bytes) {
if (typeof bytes === undefined) bytes = 8;
'undefined' must be a string, otherwise it doesn't work.
Luckily you never omit the 'bytes' argument anywhere.
from coinbin.
Another bug:
coinjs.numToVarInt = function(num) {
if (num < 253) {
return [num];
} else if (num < 65536) {
return [253].concat(coinjs.numToBytes(num,2));
} else if (num < 4294967296) {
return [254].concat(coinjs.numToBytes(num,4));
} else {
return [253].concat(coinjs.numToBytes(num,8));
}
}
Last line must be:
return [255].concat(coinjs.numToBytes(num,8));
from coinbin.
Major bug in clone():
var temp = obj.constructor();
must be
var temp = new obj.constructor();
Not only it's wrong to just call obj.constructor(), but this also fails cloning completely if transaction has any outputs, because the BigInteger 'value' copying crashes: a simple call returns 'undefined' in that case.
from coinbin.
In deterministicK() these lines make no sense:
var v = new Uint8Array(32);
v = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1];
var k = new Uint8Array(32);
k = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
There is no need to use Uint8Array(32) if you immediately overwrite it with a regular array.
from coinbin.
Hey, thanks for all your support in reviewing the code, if you aren't able to submit a pull request I'll make the amendments shorty.
from coinbin.
It would be easier for you to just make all the changes. I rewrote a lot of coin.js and removed 2/3 of the code, so my version differs too much now.
from coinbin.
your suggestions have been made and are now live. thanks.
from coinbin.
Related Issues (20)
- Taproot support
- Consider changing coinjs.newPrivkey() function to use a CSPRNG to generate random values for private keys
- I need a old version HOT 1
- Hello
- Transaction has been signed but no change in Hex HOT 1
- Fee calculation is wrong HOT 1
- Private key to address with balance check
- 2nd Transaction HOT 1
- use a HEX private key and generate all its addresses? HOT 1
- Please Assist Recovering Dogecoin Send Through CoinbIN
- Does it support SLIP-132?
- Calculate pay_to_address_script from address (ElectrumX API integration)
- coinb.in/api HOT 1
- the transaction was rejected by network rules. non-mandatory-script-verify-flag (Locktime requirement not satisfied)
- 500
- 3ATDgSunPd8MsQuJm82s4fsbWg6HTkFEsR
- Dj
- 1FeexVJtCiVkEKGJiMEgzPh3z9LSUC8t5z
- Request.
- Export recovery phrase 12 words?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from coinbin.