parent
c5f214402d
commit
6d1dadd0bf
1 changed files with 1 additions and 1 deletions
|
@ -156,7 +156,7 @@ var decodeStr = function (val, offset, length) {
|
||||||
var addLength = function (str) {
|
var addLength = function (str) {
|
||||||
var len = Buffer.byteLength(str)
|
var len = Buffer.byteLength(str)
|
||||||
var digits = Math.floor(Math.log(len) / Math.log(10)) + 1
|
var digits = Math.floor(Math.log(len) / Math.log(10)) + 1
|
||||||
if (len + digits > Math.pow(10, digits)) digits++
|
if (len + digits >= Math.pow(10, digits)) digits++
|
||||||
|
|
||||||
return (len + digits) + str
|
return (len + digits) + str
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue