block: remove use of assert
This commit is contained in:
parent
8f821f4768
commit
395c43ad74
1 changed files with 1 additions and 2 deletions
|
@ -1,4 +1,3 @@
|
||||||
var assert = require('assert')
|
|
||||||
var bufferutils = require('./bufferutils')
|
var bufferutils = require('./bufferutils')
|
||||||
var crypto = require('./crypto')
|
var crypto = require('./crypto')
|
||||||
|
|
||||||
|
@ -14,7 +13,7 @@ function Block () {
|
||||||
}
|
}
|
||||||
|
|
||||||
Block.fromBuffer = function (buffer) {
|
Block.fromBuffer = function (buffer) {
|
||||||
assert(buffer.length >= 80, 'Buffer too small (< 80 bytes)')
|
if (buffer.length < 80) throw new Error('Buffer too small (< 80 bytes)')
|
||||||
|
|
||||||
var offset = 0
|
var offset = 0
|
||||||
function readSlice (n) {
|
function readSlice (n) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue