ReedSolomon implementation in javascript