vim-patch:9.1.1774: cannot calculate sha256 of a Blob

Problem:  cannot calculate sha256() of a Blob
Solution: Change sha256() to accept a Blob or String argument
          (thinca).

closes: vim/vim#18336

4150283b83

Co-authored-by: thinca <thinca@gmail.com>
This commit is contained in:
zeertzjq
2025-09-21 06:16:20 +08:00
parent 19ba589946
commit 39a21d749d
5 changed files with 39 additions and 15 deletions

View File

@@ -8631,11 +8631,12 @@ function vim.fn.settagstack(nr, dict, action) end
function vim.fn.setwinvar(nr, varname, val) end
--- Returns a String with 64 hex characters, which is the SHA256
--- checksum of {string}.
--- checksum of {expr}.
--- {expr} is a String or a Blob.
---
--- @param string string
--- @param expr string
--- @return string
function vim.fn.sha256(string) end
function vim.fn.sha256(expr) end
--- Escape {string} for use as a shell command argument.
---