Skip to content

Commit

Permalink
Add API docs to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
lukechilds committed Jan 11, 2019
1 parent 4b568a1 commit 71dc57c
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,57 @@ byteRange.int32;
// [-2147483648, 2147483647]
```

## API

### byteRange(bytes, [options])

Returns integer ranges for a given number of bytes.

#### bytes

Type: `number`<br />
Default: `undefined`

Number of bytes to return the integer range for. Must be a positive integer.

#### options

Type: `Object`<br />
Default: `{signed: false}`

An object containing the following properties:

##### signed

Type: `boolean`<br>
Default: `false`

A boolean indicating whether the integer range is signed.

### byteRange.uint8

Precomputed byte range for an unsigned 8 bit integer.

### byteRange.uint16

Precomputed byte range for an unsigned 16 bit integer.

### byteRange.uint32

Precomputed byte range for an unsigned 32 bit integer.

### byteRange.int8

Precomputed byte range for a signed 8 bit integer.

### byteRange.int16

Precomputed byte range for a signed 16 bit integer.

### byteRange.int32

Precomputed byte range for a signed 32 bit integer.

## License

MIT © Luke Childs

0 comments on commit 71dc57c

Please sign in to comment.