WIP: morph: Fix container resource name transformer #31

Closed
aarifullin wants to merge 1 commits from aarifullin/policy-engine:fix/transform_container_target into master
Collaborator

Signed-off-by: Airat Arifullin aarifullin@yadro.com

Signed-off-by: Airat Arifullin <aarifullin@yadro.com>
aarifullin added the
bug
label 2023-12-12 14:31:04 +00:00
aarifullin force-pushed fix/transform_container_target from cbbd0b2e26 to 74dade0e43 2023-12-12 14:31:43 +00:00 Compare
aarifullin requested review from storage-services-committers 2023-12-12 14:32:25 +00:00
aarifullin requested review from storage-services-developers 2023-12-12 14:32:29 +00:00
aarifullin requested review from storage-core-committers 2023-12-12 14:32:49 +00:00
dstepanov-yadro approved these changes 2023-12-12 14:38:30 +00:00
aarifullin requested review from storage-core-developers 2023-12-12 14:50:36 +00:00
aarifullin force-pushed fix/transform_container_target from 74dade0e43 to a7bb0e6b8b 2023-12-12 14:52:07 +00:00 Compare
aarifullin requested review from dstepanov-yadro 2023-12-12 14:53:03 +00:00
fyrchik reviewed 2023-12-12 14:56:00 +00:00
@ -50,3 +51,3 @@
// Container name can be too long and, thus, cannot be
// used as a key name for policy-contract storage.
name = base58.FastBase58Encoding([]byte(target.Name))
encoded := sha256.Sum224([]byte(target.Name))

What about raw []byte slice? it's 32 bytes. Well, it is hash, so taking a prefix is almost equivalent to this Sum224.

What about raw `[]byte` slice? it's 32 bytes. Well, it _is_ hash, so taking a prefix is almost equivalent to this `Sum224`.

And why 224?

And why `224`?
elebedeva approved these changes 2023-12-12 15:04:30 +00:00
aarifullin changed title from morph: Fix container resource name transformer to WIP: morph: Fix container resource name transformer 2023-12-12 15:24:52 +00:00
aarifullin closed this pull request 2023-12-18 09:38:55 +00:00
All checks were successful
DCO action / DCO (pull_request) Successful in 52s
Tests and linters / Tests (1.21) (pull_request) Successful in 1m18s
Tests and linters / Tests (1.20) (pull_request) Successful in 1m28s
Tests and linters / Tests with -race (pull_request) Successful in 1m30s
Tests and linters / Staticcheck (pull_request) Successful in 1m30s
Tests and linters / Lint (pull_request) Successful in 2m30s

Pull request closed

Sign in to join this conversation.
There is no content yet.