us_ascii

Shifts the charcodes by 128 to create malformed US-ASCII

Created by: hackvertor
Installed 1 times

Category: Charsets

Created on: Thursday, October 31, 2024 at 11:36:26 AM

Updated on: Wednesday, November 6, 2024 at 2:17:27 PM

This is a built in tag
Tag arguments
[]
Code
class us_ascii {
  encode(input) {
    return input
      .split("")
      .map((chr) => String.fromCodePoint(chr.codePointAt() + 128))
      .join("");
  }

  decode(input) {
    return input
      .split("")
      .map((chr) => String.fromCodePoint(chr.codePointAt() - 128))
      .join("");
  }
}