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

@@ -10419,13 +10419,14 @@ M.funcs = {
base = 1,
desc = [=[
Returns a String with 64 hex characters, which is the SHA256
checksum of {string}.
checksum of {expr}.
{expr} is a String or a Blob.
]=],
name = 'sha256',
params = { { 'string', 'string' } },
params = { { 'expr', 'string' } },
returns = 'string',
signature = 'sha256({string})',
signature = 'sha256({expr})',
},
shellescape = {
args = { 1, 2 },