This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const phpassbase64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; | |
const base64translate = (input) => { | |
const res = [0]; | |
let currentBit = 0, index = 0; | |
input.split('').forEach(l => { | |
const i = phpassbase64.indexOf(l); | |
res[index] += (i << currentBit) & 0xff; | |
currentBit += 6; | |
if(currentBit >= 8) { |