Commit bf7060bc authored by Christopher League's avatar Christopher League
Browse files

Fix problem w/hex spell accepting before final length

parent 400b3c2f
......@@ -549,11 +549,12 @@ function hexSpellUpdate() {
var ok = bs.match(/^[01]*$/);
$(this).toggleClass("border-danger", !ok);
if(ok) {
var sz = bs.length;
while(bs.length % 4 != 0) {
bs = bs + '0';
}
var hx = bs.length == 0? "" : parseInt(bs,2).toString(16);
var correct = hx == "#{rawJS word}";
var correct = sz%4 == 0 && hx == "#{rawJS word}";
$("##{rawJS hexOut}").html(hx).toggleClass("border-success", correct);
if(correct) {
$(this).prop('disabled', true);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment