def split_ints(secret)
            result = []

            secret.split('').map { |x|
                data = x.unpack("H*")[0]
                "0"*(data.size % 2) + data
            }.join("").scan(/.{1,64}/) { |segment|
                result.push (segment+"0"*(64-segment.size)).hex
            }

            return result
        end
def split_ints(secret)
            result = []

            secret.split('').map { |x|
                data = x.unpack("H*")[0]
                "0"*(data.size % 2) + data
            }.join("").scan(/.{1,64}/) { |segment|
                result.push (segment+"0"*(64-segment.size)).hex
            }

            return result
        end
split_ints and merge_ints converts between string and integer array,
 where the integer is right-padded until it fits a 256 bit integer.