def ConstructTimestampAssetId(id_prefix, timestamp, device_id, uniquifier, reverse_ts=True):
 assert IdPrefix.IsValid(id_prefix), id_prefix
 assert (timestamp < (1L << 32)), timestamp
 if reverse_ts:
  timestamp = (((1L << 32) - int(timestamp)) - 1)
 byte_str = struct.pack('>I', timestamp)
 assert (len(byte_str) == 4), timestamp
 byte_str += util.EncodeVarLengthNumber(device_id)
 byte_str += _EncodeUniquifier(uniquifier)
 return (id_prefix + base64hex.B64HexEncode(byte_str, padding=False))

def ConstructTimestampAssetId ( id_prefix , timestamp , device_id , uniquifier , reverse_ts = True ) : assert IdPrefix . IsValid ( id_prefix ) , id_prefix assert ( timestamp < ( 1 L << 32 ) ) , timestamp if reverse_ts : timestamp = ( ( ( 1 L << 32 ) - int ( timestamp ) ) - 1 ) byte_str = struct . pack ( '>I' , timestamp ) assert ( len ( byte_str ) == 4 ) , timestamp byte_str += util . EncodeVarLengthNumber ( device_id ) byte_str += _EncodeUniquifier ( uniquifier ) return ( id_prefix + base64hex . B64HexEncode ( byte_str , padding = False ) )
constructs an asset id that has a leading 4-byte encoded timestamp .