Skip to content

Commit 083b140

Browse files
committed
merge conflicts
2 parents aab7c57 + 6d8b1df commit 083b140

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

src/sage/rings/finite_rings/element_base.pyx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,16 @@ cdef class FiniteRingElement(CommutativeRingElement):
144144

145145
def to_bytes(self, byteorder="big"):
146146
"""
147+
<<<<<<< HEAD
147148
Return an array of bytes representing an integer.
148149
149150
Internally relies on the python ``int.to_bytes()`` method.
150151
Length of byte array is determined from the field's order.
152+
=======
153+
Return an array of bytes representing an integer. Internally relies
154+
on the Python ``int.to_bytes()`` method. The length of the byte array
155+
is fixed by the parent field's order.
156+
>>>>>>> 6d8b1dfaf02cbd4b09f692e7d2201379553b03c4
151157
152158
INPUT:
153159
@@ -1112,10 +1118,16 @@ cdef class FinitePolyExtElement(FiniteRingElement):
11121118

11131119
def to_bytes(self, byteorder="big"):
11141120
"""
1121+
<<<<<<< HEAD
11151122
Return an array of bytes representing an integer.
11161123
11171124
Internally relies on the python ``int.to_bytes()`` method.
11181125
Length of byte array is determined from the field's order.
1126+
=======
1127+
Return an array of bytes representing an integer. Internally relies
1128+
on the Python ``int.to_bytes()`` method. The length of the byte array
1129+
is fixed by the parent field's order.
1130+
>>>>>>> 6d8b1dfaf02cbd4b09f692e7d2201379553b03c4
11191131
11201132
INPUT:
11211133

src/sage/rings/finite_rings/finite_field_base.pyx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2119,9 +2119,14 @@ cdef class FiniteField(Field):
21192119

21202120
def from_bytes(self, input_bytes, byteorder="big"):
21212121
"""
2122+
<<<<<<< HEAD
21222123
Return the integer represented by the given array of bytes.
21232124
21242125
Internally relies on the python ``int.from_bytes()`` method.
2126+
=======
2127+
Return the integer represented by the given array of bytes. Internally relies
2128+
on the Python ``int.from_bytes()`` method.
2129+
>>>>>>> 6d8b1dfaf02cbd4b09f692e7d2201379553b03c4
21252130
21262131
INPUT:
21272132
@@ -2160,7 +2165,9 @@ cdef class FiniteField(Field):
21602165
sage: for F in fields:
21612166
....: for _ in range(1000):
21622167
....: a = F.random_element()
2163-
....: assert F.from_bytes(a.to_bytes()) == a
2168+
....: order = choice(["little", "big"])
2169+
....: a_bytes = a.to_bytes(byteorder=order)
2170+
....: assert F.from_bytes(a_bytes, byteorder=order) == a
21642171
"""
21652172
python_int = int.from_bytes(input_bytes, byteorder=byteorder)
21662173
return self.from_integer(python_int)

src/sage/rings/integer.pyx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7165,9 +7165,14 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
71657165

71667166
def to_bytes(self, length=1, byteorder="big", is_signed=False):
71677167
"""
7168+
<<<<<<< HEAD
71687169
Return an array of bytes representing an integer.
71697170
71707171
Internally relies on the python ``int.to_bytes()`` method.
7172+
=======
7173+
Return an array of bytes representing an integer. Internally relies
7174+
on the Python ``int.to_bytes()`` method.
7175+
>>>>>>> 6d8b1dfaf02cbd4b09f692e7d2201379553b03c4
71717176
71727177
INPUT:
71737178

0 commit comments

Comments
 (0)