diff options
author | ezaitov <ezaitov@yandex-team.ru> | 2022-02-10 16:52:18 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:52:18 +0300 |
commit | e5a714d5df6439eb99f729bd8706f01a032c0635 (patch) | |
tree | 9837a1bccae8a2a60dfa2308549a4849c9159c4c | |
parent | efa3b4ffd701f7a7b722ec7a3da4cc371f37f7b4 (diff) | |
download | ydb-e5a714d5df6439eb99f729bd8706f01a032c0635.tar.gz |
Restoring authorship annotation for <ezaitov@yandex-team.ru>. Commit 1 of 2.
-rw-r--r-- | ydb/library/yql/udfs/common/digest/digest_udf.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ydb/library/yql/udfs/common/digest/digest_udf.cpp b/ydb/library/yql/udfs/common/digest/digest_udf.cpp index 7487a078dde..5914fdd2094 100644 --- a/ydb/library/yql/udfs/common/digest/digest_udf.cpp +++ b/ydb/library/yql/udfs/common/digest/digest_udf.cpp @@ -157,23 +157,23 @@ namespace { return valueBuilder->NewString(TStringRef(reinterpret_cast<char*>(&out[0]), outSize)); } - SIMPLE_UDF_OPTIONS(TBlake2B, char*(TAutoMap<char*>, TOptional<char*>), builder.OptionalArgs(1)) { + SIMPLE_UDF_OPTIONS(TBlake2B, char*(TAutoMap<char*>, TOptional<char*>), builder.OptionalArgs(1)) { const static ui32 outSize = 32; const static NArgonish::TBlake2BFactory bfactory; const TStringRef inputRef = args[0].AsStringRef(); - THolder<NArgonish::IBlake2Base> blake2b; - if (args[1]) { - const TStringRef keyRef = args[1].AsStringRef(); - if (keyRef.Size() == 0) { - blake2b = bfactory.Create(outSize); - } else { - blake2b = bfactory.Create(outSize, reinterpret_cast<const ui8*>(keyRef.Data()), keyRef.Size()); - } - } else { - blake2b = bfactory.Create(outSize); - } - + THolder<NArgonish::IBlake2Base> blake2b; + if (args[1]) { + const TStringRef keyRef = args[1].AsStringRef(); + if (keyRef.Size() == 0) { + blake2b = bfactory.Create(outSize); + } else { + blake2b = bfactory.Create(outSize, reinterpret_cast<const ui8*>(keyRef.Data()), keyRef.Size()); + } + } else { + blake2b = bfactory.Create(outSize); + } + ui8 out[outSize]; blake2b->Update(inputRef.Data(), inputRef.Size()); blake2b->Final(out, outSize); |