bare-buffer 3.4.2 → 3.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/ascii.js +2 -2
  2. package/package.json +1 -1
package/lib/ascii.js CHANGED
@@ -8,7 +8,7 @@ exports.toString = function toString(buffer) {
8
8
  let result = ''
9
9
 
10
10
  for (let i = 0; i < len; i++) {
11
- result += String.fromCharCode(buffer[i])
11
+ result += String.fromCharCode(buffer[i] & 0x7f)
12
12
  }
13
13
 
14
14
  return result
@@ -18,7 +18,7 @@ exports.write = function write(buffer, string) {
18
18
  const len = buffer.byteLength
19
19
 
20
20
  for (let i = 0; i < len; i++) {
21
- buffer[i] = string.charCodeAt(i)
21
+ buffer[i] = string.charCodeAt(i) & 0x7f
22
22
  }
23
23
 
24
24
  return len
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-buffer",
3
- "version": "3.4.2",
3
+ "version": "3.4.3",
4
4
  "description": "Native buffers for JavaScript",
5
5
  "exports": {
6
6
  "./package": "./package.json",