Skip to content

Instantly share code, notes, and snippets.

@zedd3v
zedd3v / px-encode-decode.ts
Last active May 30, 2024 17:00
PerimeterX Payload decode & encode functions
export interface EncodeOptions {
shift?: boolean;
shiftAmount?: number;
base64?: boolean;
}
export interface DecodeOptions extends EncodeOptions {}
export const decodePayload = (payload: string, options: DecodeOptions = {}): string => {
let { shift, base64, shiftAmount } = options;