Commit 7b74d04925fc2be0babc02e191f66a3653f83dd4
TestEnvironment: fixed hexStr2arrayBuf
Alex Beregszaszi committed on 8/16/2016, 10:26:03 PMParent: d0973468e86d175de7252854a6b36fd67495c3a4
Files changed
testEnvironment.js | changed |
testEnvironment.js | ||
---|---|---|
@@ -51,10 +51,9 @@ | ||
51 | 51 | } |
52 | 52 | } |
53 | 53 | |
54 | 54 | function hexStr2arrayBuf (string) { |
55 | - const ab = new ArrayBuffer(string.length / 2) | |
56 | - const view = new Uint8Array(ab) | |
55 | + const view = new Uint8Array(string.length / 2) | |
57 | 56 | string = [...string] |
58 | 57 | let temp = '' |
59 | 58 | string.forEach((el, i) => { |
60 | 59 | temp += el |
@@ -62,6 +61,6 @@ | ||
62 | 61 | view[(i + 1) / 2 - 1] = parseInt(temp, 16) |
63 | 62 | temp = '' |
64 | 63 | } |
65 | 64 | }) |
66 | - return ab | |
65 | + return view | |
67 | 66 | } |
Built with git-ssb-web