| 1 | initial version |
For a Sage integer (vs. python int), s.hex() gives just the hex digits, without the prefix '0x':
sage: s=123456
sage: s.hex()
'1e240'
hex(s) includes the prefix '0x':
sage: hex(s)
'0x1e240'
You could strip off '0x' with hex(s)[2:], but s.hex() is simpler.
sage: hex(s)[2:]
'1e240'
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.