require "openssl" enc = OpenSSL::Digest.new("sha256") res = enc.update("helloworld") puts res
However, where does it say in the documentation that the name of the algorithm for this purpose should be “sha256”? How can I find the acceptable arguments to
Another one was when setting permissions for creating directories. I tried and failed to generate correct permissions using:
Dir.mkdir_p(destdir, mode = 774)
Here it says that Dir.mkdir_p(destdir, mode = 511) creates a new directory at the given path, including any non-existing intermediate directories. The linux-style permission mode can be specified, with a default of 777 (0o777). I believe this needs to be fixed (that is, the default is 511). But why does it not say that the mode has to specified in the
octal format. When I tried 0o774, things worked.
In general, what is the recommended way of finding set of possible arguments and/or their type.
Thank you. BTW Crystal and Kemal combination is really awesome. I hope this language really takes off.