In C2 itself, you do not assign types, you have either number or string.
So you can go ahead and assign the value of your choice to a number variable.
Nevertheless, in the algorithm itself, before producing the hash, there is an actual lot of string manipulation going on, formatting the value as a string through several format of arrays and other (if you look at the code in the runtime of the plugin, you can check all the functions at the end of the page, after the interfacing within Construct, functions like rstr_sha256() for example).
That algorithm is pretty complex, and actually having all the manipulations done within C2 events likely won't be as fast as using the plugin itself.
But still I hope this gives you an idea of how you could actually do it.