update character limits

This commit is contained in:
afonya2 2025-05-17 18:02:39 +02:00
parent 0ebddb272d
commit 617608e46f
Signed by: afonya
GPG key ID: EBB9C4CAFAAFB2DC

4
IGA.ts
View file

@ -106,7 +106,7 @@ function checksum(input: string) {
}
let bin = ""
for (let i = 0; i < input.length; i++) {
if (input.charCodeAt(i) < 0 || input.charCodeAt(i) > 50000) {
if (input.charCodeAt(i) < 0 || input.charCodeAt(i) > 65535) {
throw new Error("Character at index " + i + " is not a valid character")
}
bin += dec2bin(input.charCodeAt(i))
@ -177,7 +177,7 @@ function hash(input: string, salt: number = 0, len: number = 32, seed?: number):
blocks[blocks.length-1][blocks[blocks.length-1].length-1].push(padding.padding[ip])
}
for (let i = 0; i < input.length; i++) {
if (input.charCodeAt(i) < 0 || input.charCodeAt(i) > 50000) {
if (input.charCodeAt(i) < 0 || input.charCodeAt(i) > 65535) {
throw new Error("Character at index " + i + " is not a valid character")
}
if (blocks[blocks.length-1].length == 16 && blocks[blocks.length-1][blocks[blocks.length-1].length-1].length == len) {