Skip to content
This repository has been archived by the owner on Jun 7, 2019. It is now read-only.

Commit

Permalink
Merge pull request #738 from LiskHQ/710-buffer-reverse
Browse files Browse the repository at this point in the history
Use React Native/Android-compatible buffer reverse function - Closes #710
  • Loading branch information
willclarktech authored Jul 23, 2018
2 parents f0fe09a + 13a092d commit 4ba6e63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"babel-runtime": "=6.26.0",
"bip39": "=2.4.0",
"browserify-bignum": "=1.3.0-2",
"buffer-reverse": "=1.0.1",
"ed2curve": "=0.2.1",
"tweetnacl": "=1.0.0",
"varuint-bitcoin": "=1.1.0"
Expand Down
5 changes: 2 additions & 3 deletions src/cryptography/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
import querystring from 'querystring';
import bignum from 'browserify-bignum';
import reverseBuffer from 'buffer-reverse';
import ed2curve from 'ed2curve';
import hash from './hash';

Expand Down Expand Up @@ -41,9 +42,7 @@ export const hexToBuffer = hex => {
};

export const getFirstEightBytesReversed = publicKeyBytes =>
Buffer.from(publicKeyBytes)
.slice(0, 8)
.reverse();
reverseBuffer(Buffer.from(publicKeyBytes).slice(0, 8));

export const toAddress = buffer => {
if (
Expand Down

0 comments on commit 4ba6e63

Please sign in to comment.