SPB Git

spb/os-vault Public

Self-custody, multi-chain crypto wallet for macOS. One recovery phrase, six chain families, zero API keys — nothing leaves your Mac.

Swift 96% Shell 3.4% Makefile 0.6%
579 B · 22 lines swift
Raw Blame History
1import Foundation23public struct VecU8<T: FixedWidthInteger & Codable>: BorshCodable, Codable, Equatable, Hashable {4    public let length: T5    public let data: Data67    public init(from reader: inout BinaryReader) throws {8        length = try T(from: &reader)9        data = try Data(reader.read(count: Int(length)))10    }1112    public init(length: T, data: Data) {13        self.length = length14        self.data = data15    }1617    public func serialize(to writer: inout Data) throws {18        try length.serialize(to: &writer)19        try data.serialize(to: &writer)20    }21}22