mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
add id de(coding)
This commit is contained in:
parent
e40cdb9608
commit
21bce8192b
1 changed files with 11 additions and 0 deletions
|
@ -164,6 +164,17 @@ def genID(static=[]):
|
|||
x -= 18446744073709551616L
|
||||
return x
|
||||
|
||||
def hexifyID(id):
|
||||
if id < 0:
|
||||
id += 18446744073709551616L
|
||||
return "%x" % id
|
||||
|
||||
def dehexifyID(id):
|
||||
id = int(id, 16)
|
||||
if id >= 9223372036854775808L:
|
||||
id -= 18446744073709551616L
|
||||
return id
|
||||
|
||||
def ids2str(ids):
|
||||
"""Given a list of integers, return a string '(int1,int2,.)'
|
||||
|
||||
|
|
Loading…
Reference in a new issue