0
我有這個python代碼片段,需要與clojure等效的幫助。Clojure相當於python的base64編碼和解碼
user_id = row.get('user_id')
if user_id:
user_id_bytes = base64.urlsafe_b64decode(user_id)
creation_timestamp = int.from_bytes(user_id_bytes[:4],
byteorder='big')
dc_id = int.from_bytes(user_id_bytes[4:5], byteorder='big') & 31
if creation_timestamp > WHEN_WE_SET_UP_DC_IDS:
row['dc_id'] = dc_id}