Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

b4a

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

b4a - npm Package Compare versions

Comparing version 1.5.3 to 1.6.0

78

browser.js

@@ -398,2 +398,70 @@ const ascii = require('./lib/ascii')

function writeDoubleLE (buffer, value, offset) {
if (offset === undefined) offset = 0
const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength)
view.setFloat64(offset, value, true)
return offset + 8
}
function writeFloatLE (buffer, value, offset) {
if (offset === undefined) offset = 0
const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength)
view.setFloat32(offset, value, true)
return offset + 4
}
function writeUInt32LE (buffer, value, offset) {
if (offset === undefined) offset = 0
const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength)
view.setUint32(offset, value, true)
return offset + 4
}
function writeInt32LE (buffer, value, offset) {
if (offset === undefined) offset = 0
const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength)
view.setInt32(offset, value, true)
return offset + 4
}
function readDoubleLE (buffer, offset) {
if (offset === undefined) offset = 0
const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength)
return view.getFloat64(offset, true)
}
function readFloatLE (buffer, offset) {
if (offset === undefined) offset = 0
const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength)
return view.getFloat32(offset, true)
}
function readUInt32LE (buffer, offset) {
if (offset === undefined) offset = 0
const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength)
return view.getUint32(offset, true)
}
function readInt32LE (buffer, offset) {
if (offset === undefined) offset = 0
const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength)
return view.getInt32(offset, true)
}
module.exports = {

@@ -420,3 +488,11 @@ isBuffer,

toString,
write
write,
writeDoubleLE,
writeFloatLE,
writeUInt32LE,
writeInt32LE,
readDoubleLE,
readFloatLE,
readUInt32LE,
readInt32LE
}

@@ -86,2 +86,34 @@ function isBuffer (value) {

function writeDoubleLE (buffer, value, offset) {
return toBuffer(buffer).writeDoubleLE(value, offset)
}
function writeFloatLE (buffer, value, offset) {
return toBuffer(buffer).writeFloatLE(value, offset)
}
function writeUInt32LE (buffer, value, offset) {
return toBuffer(buffer).writeUInt32LE(value, offset)
}
function writeInt32LE (buffer, value, offset) {
return toBuffer(buffer).writeInt32LE(value, offset)
}
function readDoubleLE (buffer, offset) {
return toBuffer(buffer).readDoubleLE(offset)
}
function readFloatLE (buffer, offset) {
return toBuffer(buffer).readFloatLE(offset)
}
function readUInt32LE (buffer, offset) {
return toBuffer(buffer).readUInt32LE(offset)
}
function readInt32LE (buffer, offset) {
return toBuffer(buffer).readInt32LE(offset)
}
module.exports = {

@@ -108,3 +140,11 @@ isBuffer,

toString,
write
write,
writeDoubleLE,
writeFloatLE,
writeUInt32LE,
writeInt32LE,
readDoubleLE,
readFloatLE,
readUInt32LE,
readInt32LE
}

2

package.json
{
"name": "b4a",
"version": "1.5.3",
"version": "1.6.0",
"description": "Bridging the gap between buffers and typed arrays",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -111,4 +111,36 @@ # Buffer for Array

#### `b4a.writeDoubleLE(buffer, value[, offset])`
See https://nodejs.org/api/buffer.html#bufwritedoublelevalue-offset
#### `b4a.writeFloatLE(buffer, value[, offset])`
See https://nodejs.org/api/buffer.html#bufwritefloatlevalue-offset
#### `b4a.writeUInt32LE(buffer, value[, offset])`
https://nodejs.org/api/buffer.html#bufwriteuint32levalue-offset
#### `b4a.writeInt32LE(buffer, value[, offset])`
See https://nodejs.org/api/buffer.html#bufwriteint32levalue-offset
### `b4a.readDoubleLE(buffer[, offset])`
See https://nodejs.org/api/buffer.html#bufreaddoubleleoffset
### `b4a.readFloatLE(buffer[, offset])`
See https://nodejs.org/api/buffer.html#bufreadfloatleoffset
### `b4a.readUInt32LE(buffer[, offset])`
See https://nodejs.org/api/buffer.html#bufreaduint32leoffset
### `b4a.readInt32LE(buffer[, offset])`
See https://nodejs.org/api/buffer.html#bufreadint32leoffset
## License
ISC
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc