from fission.core.pipes import BasePipe
import struct


class StringToIntPipe(BasePipe):
    BLOCK_SIZE=4
    def unpack(self, data):
        i, = struct.unpack("!i", data)
        return i

    def pack(self, data):
        try:
            b = struct.pack("!i", int(data))
        except ValueError:
            b = struct.pack("!i", 0)
        return b
b418e101c679a37b48b0ae6b9ca4b0e221cc85fd
<mask token>


class StringToIntPipe(BasePipe):
    <mask token>
    <mask token>

    def pack(self, data):
        try:
            b = struct.pack('!i', int(data))
        except ValueError:
            b = struct.pack('!i', 0)
        return b

<mask token>


class StringToIntPipe(BasePipe):
    <mask token>

    def unpack(self, data):
        i, = struct.unpack('!i', data)
        return i

    def pack(self, data):
        try:
            b = struct.pack('!i', int(data))
        except ValueError:
            b = struct.pack('!i', 0)
        return b

<mask token>


class StringToIntPipe(BasePipe):
    BLOCK_SIZE = 4

    def unpack(self, data):
        i, = struct.unpack('!i', data)
        return i

    def pack(self, data):
        try:
            b = struct.pack('!i', int(data))
        except ValueError:
            b = struct.pack('!i', 0)
        return b

from fission.core.pipes import BasePipe
import struct


class StringToIntPipe(BasePipe):
    BLOCK_SIZE = 4

    def unpack(self, data):
        i, = struct.unpack('!i', data)
        return i

    def pack(self, data):
        try:
            b = struct.pack('!i', int(data))
        except ValueError:
            b = struct.pack('!i', 0)
        return b

from fission.core.pipes import BasePipe
import struct


class StringToIntPipe(BasePipe):
    BLOCK_SIZE=4
    def unpack(self, data):
        i, = struct.unpack("!i", data)
        return i

    def pack(self, data):
        try:
            b = struct.pack("!i", int(data))
        except ValueError:
            b = struct.pack("!i", 0)
        return b