How to create Binary attribute value in aws-sdk-php for dynamodb putItem

0

I have a hex representation of a binary value (e.g. "ed634d...").

Using the aws-sdk-php to deal with a dynamoDB PutItem call, how would I feed that value to it? How do I need to convert it for DynamoDB to recognize it as the bytes that are the source for that hex representation?

        $this->client->putItem([
            'Item' => [
                'encryptedCredentials' => [
            //  This doesn't work. What binary representation would work here?
                    'B' => 'ed634d...',
                ],
  • What exception are you getting?

  • I was given the answer. I needed to use 'B' => hex2bin('ed634d...'),

  • @Leeroy Hannigan I wasn't actually getting an exception. However, another script that needed that value was choking on it.

    I've posted the solution as an answer below.

질문됨 2년 전205회 조회
1개 답변
0
수락된 답변

I was given the answer. I needed to use
'B' => hex2bin('ed634d...'),

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠