SHA-1: Difference between revisions
Content added Content deleted
(Add Jsish) |
|||
Line 692: | Line 692: | ||
=={{header|Java}}== |
=={{header|Java}}== |
||
The solution to this task would be a small modification to [[MD5#Java|MD5]] (replacing "MD5" with "SHA-1" as noted [http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#MessageDigest here]). |
The solution to this task would be a small modification to [[MD5#Java|MD5]] (replacing "MD5" with "SHA-1" as noted [http://docs.oracle.com/javase/7/docs/technotes/guides/security/StandardNames.html#MessageDigest here]). |
||
=={{header|Jsish}}== |
|||
<lang javascript>/* SHA-1 hash in Jsish */ |
|||
var str = 'Rosetta code'; |
|||
puts(Util.hash(str, {type:'sha1'})); |
|||
/* |
|||
=!EXPECTSTART!= |
|||
b18c883f4da750164b5af362ea9b9f27f90904b4 |
|||
=!EXPECTEND!= |
|||
*/</lang> |
|||
{{out}} |
|||
<pre>prompt$ jsish sha-1.jsi |
|||
b18c883f4da750164b5af362ea9b9f27f90904b4 |
|||
prompt$ jsish -u sha-1.jsi |
|||
[PASS] sha-1.jsi</pre> |
|||
=={{header|Julia}}== |
=={{header|Julia}}== |