Javascript port of python's itsdangerous