my funny js signature generator. *NOT* optimal for all cases, but contains the gist of the logic and works for simple cases, improvements and edge cases handling will come later.