Forsaken Password Generator
Having problems with Forsaken on the Sony Playstation?
No problem!
Some remarks:
|
|
Copyright 1998 by Tobias Bading
var symbols = new Array (“0”, “1”, “2”, “3”, “4”, “5”, “6”, “7”, “8”, “9”, “B”, “C”, “D”, “F”, “G”, “H”, “J”, “K”, “L”, “M”, “N”, “P”, “Q”, “R”, “S”, “T”, “V”, “W”, “X”, “Y”, “Z”, “+”) function compute_password () { var bike = document.userinput.bike.selectedIndex var skill = document.userinput.skill.selectedIndex var level = document.userinput.level.selectedIndex var lives = document.userinput.lives.selectedIndex var gold = document.userinput.gold.selectedIndex var crystals = document.userinput.crystals.selectedIndex var part1, part2, checksum, password = “” part1 = (crystals << 8) + (level << 4) + ((lives & 7) << 1) part2 = (bike << 16) + (gold << 12) + (skill << 10) + ((lives & 24) << 5) checksum = level + bike + (skill << 2) + (gold << 4) + (crystals << 4) + (lives << 5) + (lives >> 3) checksum &= 255 part1 += checksum << 12 part2 += checksum password += symbols[part1 >> 15] password += symbols[(part1 >> 10) & 31] password += symbols[(part1 >> 5) & 31] password += symbols[part1 & 31] password += symbols[part2 >> 15] password += symbols[(part2 >> 10) & 31] password += symbols[(part2 >> 5) & 31] password += symbols[part2 & 31] document.userinput.password.value = password } function symbol2value (symbol) { var i for (i = 0; i < 32; ++i) if (symbols[i] == symbol) return i return -1 } function decode_password () { var password = document.userinput.password.value var part1, part2, checksum, bike, skill, level, lives, gold, crystals, i, j password = password.toUpperCase () if (password.length != 8) { alert (“”” + password + “””” is not a valid password.””) return } part1 = symbol2value(password.charAt(0)) << 15 part1 += symbol2value(password.charAt(1)) << 10 part1 += symbol2value(password.charAt(2)) << 5 part1 += symbol2value(password.charAt(3)) part2 = symbol2value(password.charAt(4)) << 15 part2 += symbol2value(password.charAt(5)) << 10 part2 += symbol2value(password.charAt(6)) << 5 part2 += symbol2value(password.charAt(7)) bike = (part2 >> 16) & 15 skill = (part2 >> 10) & 3 level = (part1 >> 4) & 15 lives = ((part2 >> 5) & 24) + ((part1 >> 1) & 7) gold = (part2 >> 12) & 15 crystals = (part1 >> 8) & 15 checksum = level + bike + (skill << 2) + (gold << 4) + (crystals << 4) + (lives << 5) + (lives >> 3) checksum &= 255 if (part1 != ((crystals << 8) + (level << 4) + ((lives & 7) << 1) + (checksum << 12)) || part2 != ((bike << 16) + (gold << 12) + (skill << 10) + ((lives & 24) << 5) + checksum)) { alert (“””””” + password + “””” is not a valid password.””) return } document.userinput.bike.selectedIndex = bike document.userinput.skill.selectedIndex = skill document.userinput.level.selectedIndex = level document.userinput.lives.selectedIndex = lives document.userinput.gold.selectedIndex = gold document.userinput.crystals.selectedIndex = crystals document.userinput.password.value = password } compute_password ()”
The image featured at the top of this post is ©Square Enix.