Fix binary data as input in byte mode
This commit is contained in:
parent
557e0d80f7
commit
975eecd0d0
1 changed files with 4 additions and 1 deletions
|
@ -3,7 +3,10 @@ const Mode = require('./mode')
|
|||
|
||||
function ByteData (data) {
|
||||
this.mode = Mode.BYTE
|
||||
this.data = new Uint8Array(encodeUtf8(data))
|
||||
if (typeof (data) === 'string') {
|
||||
data = encodeUtf8(data)
|
||||
}
|
||||
this.data = new Uint8Array(data)
|
||||
}
|
||||
|
||||
ByteData.getBitsLength = function getBitsLength (length) {
|
||||
|
|
Loading…
Reference in a new issue