Skip to content
  • Projects
  • Groups
  • Snippets
  • Help

Owo Sugiana / opensipkd-iso8583

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • opensipkd-iso8583
  • opensipkd
  • streamer
  • pos.py
  • Owo Sugiana's avatar
    Bug fixed streamer pos · f7a845f9
    Owo Sugiana committed Sep 24, 2020
    f7a845f9 Browse Files
pos.py 362 Bytes
RawBlameHistoryPermalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
from .mitracomm import Streamer as BaseStreamer


class Streamer(BaseStreamer):
    def get_size(self, raw):  # Override
        a, b = raw
        b = b * 256
        return b + a

    def set(self, raw):  # Override
        size = len(raw)
        b = size % 256
        a = int(size / 256)
        header = bytes([b]) + bytes([a])
        return header + raw