My classic TEA javaScript implementation