Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to identify binary digits as integers?

I would like to know how to recognize the ASCII binary codes of a string as integers values. Look at the following example.

sage: from sage.crypto.util import ascii_to_bin

sage: ascii_to_bin('Hi')

0100100001101001

sage: ascii_to_bin('Hi')[4]

1

sage: ascii_to_bin('Hi')[4] in ZZ

False

sage:

I would be thankful if I get some tips on how to identify the binary digits as integers.