aboutsummaryrefslogtreecommitdiffstats
path: root/hash.js
diff options
context:
space:
mode:
Diffstat (limited to 'hash.js')
-rw-r--r--hash.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/hash.js b/hash.js
index dc033a2..bcca175 100644
--- a/hash.js
+++ b/hash.js
@@ -24,10 +24,10 @@ hash:
let Algos = [
["md2", "MD2 Algorithm"],
["md5", "MD5 Algorithm"],
- ["sha1", "SHA1 Algorithm"],
- ["sha256", "SHA256 Algorithm"],
- ["sha384", "SHA385 Algorithm"],
- ["sha512", "SHA512 Algorithm"],
+ ["sha1", "SHA-1 Algorithm"],
+ ["sha256", "SHA-256 Algorithm"],
+ ["sha384", "SHA-385 Algorithm"],
+ ["sha512", "SHA-512 Algorithm"],
];
function getStream(path)
@@ -47,9 +47,9 @@ hash:
commands.addUserCommand(["hash"], "hash of file",
- function(args){
+ function(args) {
if (args.length!=2) {
-
+
liberator.echo("usage \":hash md2|md5|sha1|sha256|sha384|sha512 file-path\"");
return false;
}
@@ -67,13 +67,13 @@ hash:
let hash = Crypt.finish(false);
// convert the binary hash data to a hex string.
- let str = [toHexString(hash.charCodeAt(i)) for(i in hash)].join("");
+ let str = [toHexString(hash.charCodeAt(i)) for (i in hash)].join("");
util.copyToClipboard(str, true);
},
{
bang: true,
- completer: function (context){
- let args = context.value.split(/\s/);
+ completer: function (context) {
+ let args = context.value.split(/\s+/);
if (args.length<=2) {
context.title = "hash algorithm";
context.completions = Algos;