Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
packer.py42 linesDownload Raw Back to flatbuffers
1# Copyright 2016 Google Inc. All rights reserved.2#3# Licensed under the Apache License, Version 2.0 (the "License");4# you may not use this file except in compliance with the License.5# You may obtain a copy of the License at6#7#     http://www.apache.org/licenses/LICENSE-2.08#9# Unless required by applicable law or agreed to in writing, software10# distributed under the License is distributed on an "AS IS" BASIS,11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.12# See the License for the specific language governing permissions and13# limitations under the License.14 15"""Provide pre-compiled struct packers for encoding and decoding.16 17See: https://docs.python.org/2/library/struct.html#format-characters18"""19 20import struct21from . import compat22 23 24boolean = struct.Struct(compat.struct_bool_decl)25 26uint8 = struct.Struct("<B")27uint16 = struct.Struct("<H")28uint32 = struct.Struct("<I")29uint64 = struct.Struct("<Q")30 31int8 = struct.Struct("<b")32int16 = struct.Struct("<h")33int32 = struct.Struct("<i")34int64 = struct.Struct("<q")35 36float32 = struct.Struct("<f")37float64 = struct.Struct("<d")38 39uoffset = uint3240soffset = int3241voffset = uint1642 
codekingpro/portable-devtools · Team Ai