mirror of
https://github.com/Merricx/qrazybox.git
synced 2024-11-21 18:42:57 +01:00
update to suppport up to version 40
This commit is contained in:
parent
a8167f9bc5
commit
d53a0786ea
1 changed files with 17 additions and 1 deletions
18
js/sqrd.js
18
js/sqrd.js
|
@ -870,6 +870,12 @@ function QRDecode(data){
|
|||
|
||||
if(mode == 0b0001){
|
||||
var length_indicator = 10;
|
||||
if ( version > 9 && version <= 26 ){
|
||||
length_indicator = 12;
|
||||
} else if ( version > 26 ){
|
||||
length_indicator = 14;
|
||||
}
|
||||
|
||||
var num = "";
|
||||
length = parseInt(data_bits.substring(0, length_indicator), 2);
|
||||
temp_data += "["+data_bits.substring(0, length_indicator)+"] [";
|
||||
|
@ -908,6 +914,12 @@ function QRDecode(data){
|
|||
|
||||
} else if(mode == 0b0010){
|
||||
var length_indicator = 9;
|
||||
if ( version > 9 && version <= 26 ){
|
||||
length_indicator = 11;
|
||||
} else if ( version > 26 ){
|
||||
length_indicator = 13;
|
||||
}
|
||||
|
||||
var current_data = "";
|
||||
length = parseInt(data_bits.substring(0, length_indicator), 2);
|
||||
temp_data += "["+data_bits.substring(0, length_indicator)+"] [";
|
||||
|
@ -950,6 +962,10 @@ function QRDecode(data){
|
|||
|
||||
} else if(mode == 0b0100){
|
||||
var length_indicator = 8;
|
||||
if ( version > 9 ){
|
||||
length_indicator = 16;
|
||||
}
|
||||
|
||||
var current_data = "";
|
||||
length = parseInt(data_bits.substring(0, length_indicator), 2);
|
||||
temp_data += "["+data_bits.substring(0, length_indicator)+"] [";
|
||||
|
@ -1232,4 +1248,4 @@ function readDataBits(data_bits){
|
|||
}
|
||||
|
||||
return data.join("");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue