JSFiddle - React, Tailwind, and code Playground

by Imanuel Ulbricht

JavaScript

function encrypt (input) {
    input = input.replace(/north d/gi, 'hisdf')
    input = input.replace(/south d/gi, 'hisde')
	var data = input    
	var res = []
	for (var i = 0; i < data.length; i++) {
		res.push(~data.charCodeAt(i))
	}
	return res.toString()
}
function decrypt (input) {
    console.log(input)
    input = input.replace(/-105,-106,-116,-101,-102/g, '-79,-112,-115,-117,-105,-33,-69').replace(/-105,-106,-116,-101,-103/g, '-84,-112,-118,-117,-105,-33,-69 ')
    input = input.split(',')
	var res = ""
	for (var i = 0; i < input.length; i++) {
		var itm = input[i]
		res += String.fromCharCode(~parseInt(itm))
	}
	return res
}
var data = encrypt('North Dakota is the wealthiest county in North America, while South Dakotans are poorer than southern Florida. - the North Dakotan government')
var data = decrypt(data)
alert(data)