def intdigest(self): return self.h and bin_to_num(self.h)
def intdigest(self): return self.h and int(bin_to_num(self.h))
def test_num_to_bin_bin_to_num_is_idempotent(self): expected = b'\x06\x00\x00\x9c\xbf\xeb\x83\xdb' result = num_to_bin(bin_to_num(b'\x06\x00\x00\x9c\xbf\xeb\x83\xdb')) assert expected == result
def intdigest(self): if self.hd: return codec.bin_to_num(self.hd)
def test_bin_to_num_large_number(self): expected = 432346237462348763 result = bin_to_num(b'\x06\x00\x00\x9c\xbf\xeb\x83\xdb') assert expected == result
def test_bin_to_num_and_num_to_bin_is_idempotent(self): expected = 432346237462348763 result = bin_to_num(num_to_bin(432346237462348763)) assert expected == result
def test_bin_to_num_basic(self): expected = 123 result = bin_to_num(b'{') assert expected == result
def test_bin_to_num_zero(self): expected = 0 result = bin_to_num(b'\x00') assert expected == result
def test_num_to_bin_bin_to_num_is_idempotent(self): expected = '\x06\x00\x00\x9c\xbf\xeb\x83\xdb' result = num_to_bin(bin_to_num('\x06\x00\x00\x9c\xbf\xeb\x83\xdb')) assert expected == result
def test_bin_to_num_null(self): expected = 0 result = bin_to_num('\x00') assert expected == result
def test_bin_to_num_large_number(self): expected = 432346237462348763 result = bin_to_num('\x06\x00\x00\x9c\xbf\xeb\x83\xdb') assert expected == result
def test_bin_to_num_basic(self): expected = 123 result = bin_to_num('{') assert expected == result