New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

block-file

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

block-file - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

test/lorem-ipsum.1k.txt

11

package.json
{
"name" : "block-file"
, "version" : "1.0.2"
, "version" : "1.0.3"
, "description" : "A library to read/write blocks from a file"

@@ -17,6 +17,2 @@ , "keywords" : ["block", "buffer", "storage"]

, "README.md"
, "lorem-ipsum.1k.txt"
, "lorem-ipsum.4k.txt"
, "lorem-ipsum.64k.txt"
, "lib/package.json"
, "lib/block_file.js"

@@ -29,2 +25,5 @@ , "lib/fsm_naive.js"

, "lib/y-fs.js"
, "test/lorem-ipsum.1k.txt"
, "test/lorem-ipsum.4k.txt"
, "test/lorem-ipsum.64k.txt"
, "test/00-basic.js"

@@ -38,3 +37,3 @@ , "test/01-Handle.js"

, "license" : "MIT"
, "scripts" : { "test" : "mocha -R spec -s 1" }
, "scripts" : { "test" : "mocha -R spec -s 1 test/??-*.js" }
, "dependencies": { "crc" : ">=0.2.0"

@@ -41,0 +40,0 @@ , "async" : ">=0.2.6"

@@ -82,2 +82,4 @@ # Block File Libary

I haven't figured out how to get 64 to be encoded yet. Just stick with `32` ok.
Number of bit a handle value is contained as: `32` or `64`. Only encoding

@@ -89,18 +91,29 @@ into a 32bit value is supported with `32`. While `64` can not currently be

#### blockSzBits
default: `12`
4k blocks are default. `pow(2,12) == 4096`
#### fsmSzBits
default: blockSzBits
number of blocks per segment minus a checksum. Basically the free space map
is a bit field `pow(fsmSzBits)` bytes long. However for safety we checksum the
bit field. That checksum (either 16 or 32 bits consumes 2 or 4 bytes of the
bit field. So the number of blocks in a segment is the same as the number of
bits in the Free Space Map minus the checksum bits.
If you make your blockSzBits smaller, feel free to keep the fsmSzBits large
by explicitly setting the value.
#### spanNumBits
default: 2
default: `4`
Size of span in orders of 2:
original block + spanNumBits as an unsigned integer blocks
original block + pow(2, spanNum)-1 blocks
* 0 => no span blocks (just the original block)
* 1 => 1 or 2 blocks (aka original block + one more)
* 2 => 1, 2, 4, 8, or 16 blocks
* 3 => 1, 2, 4, 8, 16, 32, 64, 128, or 256 blocks
* 4 => 1, 2, ..., or 65536 blocks
* 5 (really do you need more ?!?)
* 2 => 1, 2, 3, or 4 blocks
* 3 => 1, 2, 3, 4, 5, 6, 7, or 8 blocks
* 4 => 1, 2, 3, ..., or 16 blocks
* 5 (are you getting the pattern yet?)

@@ -107,0 +120,0 @@

@@ -24,7 +24,7 @@ /* global describe it */

, fnStat
, lorem4k_fn = 'lorem-ipsum.4k.txt'
, lorem4k_fn = 'test/lorem-ipsum.4k.txt'
, lorem4kStr
, lorem4kSiz
, lorem4kBuf
, lorem64k_fn = 'lorem-ipsum.64k.txt'
, lorem64k_fn = 'test/lorem-ipsum.64k.txt'
, lorem64kStr

@@ -31,0 +31,0 @@ , lorem64kSiz

@@ -24,11 +24,11 @@ /* global describe it */

, fnStat
, lorem1k_fn = 'lorem-ipsum.1k.txt'
, lorem1k_fn = 'test/lorem-ipsum.1k.txt'
, lorem1kStr
, lorem1kSiz
, lorem1kBuf
, lorem4k_fn = 'lorem-ipsum.4k.txt'
, lorem4k_fn = 'test/lorem-ipsum.4k.txt'
, lorem4kStr
, lorem4kSiz
, lorem4kBuf
, lorem64k_fn = 'lorem-ipsum.64k.txt'
, lorem64k_fn = 'test/lorem-ipsum.64k.txt'
, lorem64kStr

@@ -35,0 +35,0 @@ , lorem64kSiz

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