Skip to content

Commit c1798db

Browse files
committed
Finished refactor Bexter so rawify and derawify can be called externally as static and class methods
1 parent 8c038c9 commit c1798db

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

Diff for: src/keri/core/coring.py

+4-12
Original file line numberDiff line numberDiff line change
@@ -2646,7 +2646,8 @@ def __init__(self, raw=None, qb64b=None, qb64=None, qb2=None,
26462646
raise ValidationError("Invalid code = {} for Bexter."
26472647
"".format(self.code))
26482648

2649-
def _rawify(self, bext):
2649+
@staticmethod
2650+
def _rawify(bext):
26502651
"""Returns raw value equivalent of Base64 text.
26512652
Suitable for variable sized matter
26522653
@@ -2661,7 +2662,7 @@ def _rawify(self, bext):
26612662
return raw # raw binary equivalent of text
26622663

26632664
@classmethod
2664-
def _decode(cls, raw, code):
2665+
def _derawify(cls, raw, code):
26652666
"""Returns decoded raw as B64 str aka bext value
26662667
26672668
Returns:
@@ -2684,16 +2685,7 @@ def bext(self):
26842685
Property bext: Base64 text value portion of qualified b64 str
26852686
Returns the value portion of .qb64 with text code and leader removed
26862687
"""
2687-
return self._decode(raw=self.raw, code=self.code)
2688-
#_, _, _, _, ls = self.Sizes[self.code]
2689-
#bext = encodeB64(bytes([0] * ls) + self.raw)
2690-
#ws = 0
2691-
#if ls == 0 and bext:
2692-
#if bext[0] == ord(b'A'): # strip leading 'A' zero pad
2693-
#ws = 1
2694-
#else:
2695-
#ws = (ls + 1) % 4
2696-
#return bext.decode('utf-8')[ws:]
2688+
return self._derawify(raw=self.raw, code=self.code)
26972689

26982690

26992691
class Pather(Bexter):

0 commit comments

Comments
 (0)