Fix bug with encoding fixed ID values that are exactly a powe of 64
This commit is contained in:
parent
f90794070a
commit
0a054b8d94
1 changed files with 1 additions and 1 deletions
|
@ -76,7 +76,7 @@ function encodeCustom(custom, verbose) {
|
||||||
hash += Base64.fromIntN(i, 2) + Base64.fromIntN(val.replaceAll(" ", "%20").length, 2) + val.replaceAll(" ", "%20"); //values cannot go above 4096 chars!!!! Is this ok?
|
hash += Base64.fromIntN(i, 2) + Base64.fromIntN(val.replaceAll(" ", "%20").length, 2) + val.replaceAll(" ", "%20"); //values cannot go above 4096 chars!!!! Is this ok?
|
||||||
}
|
}
|
||||||
} else if (typeof (val) === "number" && val != 0) {
|
} else if (typeof (val) === "number" && val != 0) {
|
||||||
let len = Math.max(1, Math.ceil(log(64, Math.abs(val))));
|
let len = Math.max(1, Math.ceil(log(64, Math.abs(val) + 1)));
|
||||||
let sign = Boolean(val / Math.abs(val) < 0) | 0;
|
let sign = Boolean(val / Math.abs(val) < 0) | 0;
|
||||||
//console.log(sign);
|
//console.log(sign);
|
||||||
//hash += Base64.fromIntN(i,2) + Base64.fromIntN(val,Math.max(1,Math.ceil(log(64,Math.abs(val))))) + "_";
|
//hash += Base64.fromIntN(i,2) + Base64.fromIntN(val,Math.max(1,Math.ceil(log(64,Math.abs(val))))) + "_";
|
||||||
|
|
Loading…
Reference in a new issue