Skip to content

Commit

Permalink
Merge pull request #35 from nedap/main-fix-base64
Browse files Browse the repository at this point in the history
Fix base64 constructor in TagEncodable class
  • Loading branch information
ronweikamp authored Feb 4, 2025
2 parents 16b4312 + 79cd731 commit 4fbb8b0
Show file tree
Hide file tree
Showing 4 changed files with 165 additions and 55 deletions.
4 changes: 2 additions & 2 deletions epcpy/epc_schemes/base_scheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from enum import Enum
from typing import Dict, Optional, Type, TypeVar

from epcpy.utils.common import ConvertException, hex_to_base64, hex_to_binary
from epcpy.utils.common import ConvertException, base64_to_hex, hex_to_base64, hex_to_binary
from epcpy.utils.regex import TAG_URI

T_EPCScheme = TypeVar("T_EPCScheme", bound="EPCScheme")
Expand Down Expand Up @@ -164,7 +164,7 @@ def from_base64(
Returns:
TagEncodable: Instance of TagEncodable class
"""
return cls.from_binary(hex_to_base64(tag_base64_string))
return cls.from_hex(base64_to_hex(tag_base64_string))

@classmethod
def from_tag_uri(
Expand Down
189 changes: 140 additions & 49 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 4fbb8b0

Please sign in to comment.