summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorc-blake <c-blake@users.noreply.github.com>2019-04-10 11:48:22 -0400
committerAndreas Rumpf <rumpf_a@web.de>2019-04-10 17:48:22 +0200
commit1394978347dc2f71d7c71f36cb3b62591a7bf908 (patch)
treed322d4c007d55ab5b1028f1f7472dbf6303b88a2
parent1494d88fa27a31b46884799b2ff9712c73937551 (diff)
downloadNim-1394978347dc2f71d7c71f36cb3b62591a7bf908.tar.gz
Make `secureHash` accept any `openArray[char]`, not only `string`. (#10988)
* Make `secureHash` accept any `openArray[char]`, not only `string`.

* Put in a changelog entry as per Araq request.
-rw-r--r--changelog.md3
-rw-r--r--lib/std/sha1.nim2
2 files changed, 4 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index 85834fb3e..d66268bd5 100644
--- a/changelog.md
+++ b/changelog.md
@@ -49,6 +49,9 @@
 
 - `osproc.execProcess` now also takes a `workingDir` parameter.
 
+- `std/sha1.secureHash` now accepts `openArray[char]`, not `string`. (Former
+   successful matches should keep working, though former failures will not.)
+
 - `options.UnpackError` is no longer a ref type and inherits from `system.Defect`
   instead of `system.ValueError`.
 
diff --git a/lib/std/sha1.nim b/lib/std/sha1.nim
index b5660f244..4cc38ec2e 100644
--- a/lib/std/sha1.nim
+++ b/lib/std/sha1.nim
@@ -194,7 +194,7 @@ proc finalize(ctx: var Sha1State): Sha1Digest =
 
 # Public API
 
-proc secureHash*(str: string): SecureHash =
+proc secureHash*(str: openArray[char]): SecureHash =
   ## Generates a ``SecureHash`` from a ``str``.
   ##
   ## **See also:**