Alex Beregszaszi

Results 333 issues of Alex Beregszaszi

Compared to the benchmarks in #121 it performs as: ``` bn.js pown#pow x 11,994 ops/sec ±3.01% (9 runs sampled) bn.js ipown#pow x 11,417 ops/sec ±5.09% (9 runs sampled) ``` However...

feature / refactor

This changes pow() to be in-place and adds the usual wrapper. Also added a test case for the special 0 power case.

feature / refactor

(Taking the discussion from #112 to here) Proposed changes: - [x] Make `.modn()` return a BN (#112) - [x] Renaming `.strip()` to `._strip()` is a breaking change too (#105) -...

semver-major

And the preferred way for large numbers is `.add(new BN(...))`

question / documentation

Would be nice to have an official recommendation on optional parameters: - should they be discouraged - should they be after `offset` in `encode` and `end` in `decode` - any...

This simple encoder/decoder for https://github.com/jbenet/multihash/ works based on #1: ``` // Test vector: "0x11","0x14","0x0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33" function encode(uint hashtype, uint size, bytes digest) returns (bytes hash) { hash = new bytes(2 +...

Piece of code to copy chunks of `bytes`: ``` function copyBytes(bytes from, uint fromOffset, uint length, uint toOffset) returns (bytes) { bytes memory to = new bytes(toOffset + length); return...

See https://github.com/trezor/trezor-crypto/blob/master/bignum.c

I've created a library (called [ethereumjs-wallet](https://github.com/axic/ethereumjs-wallet/)) for handling Ethereum keys and converting between different formats. It is almost affected by the [NIH-syndrome](https://en.wikipedia.org/wiki/Not_invented_here), but it aims to be really small and...