{"id":16124750,"url":"https://github.com/emilbayes/pony-endianness","last_synced_at":"2025-04-06T12:49:03.941Z","repository":{"id":66092757,"uuid":"161999055","full_name":"emilbayes/pony-endianness","owner":"emilbayes","description":"Easily read different Integer types from an `Array[U8]` as either big or little endian encoding.","archived":false,"fork":false,"pushed_at":"2018-12-16T13:02:52.000Z","size":5,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T18:54:26.994Z","etag":null,"topics":["library","pony-language"],"latest_commit_sha":null,"homepage":"","language":"Pony","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emilbayes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-16T12:31:42.000Z","updated_at":"2021-10-27T22:54:27.000Z","dependencies_parsed_at":"2023-03-24T01:09:14.276Z","dependency_job_id":null,"html_url":"https://github.com/emilbayes/pony-endianness","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilbayes%2Fpony-endianness","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilbayes%2Fpony-endianness/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilbayes%2Fpony-endianness/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emilbayes%2Fpony-endianness/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emilbayes","download_url":"https://codeload.github.com/emilbayes/pony-endianness/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247485251,"owners_count":20946398,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["library","pony-language"],"created_at":"2024-10-09T21:23:28.776Z","updated_at":"2025-04-06T12:49:03.922Z","avatar_url":"https://github.com/emilbayes.png","language":"Pony","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `endianness`\n\n\u003e Easily read different Integer types from an `Array[U8]` as either big or little endian encoding.\n\nExtracted from the core \"buffered\" package\n\n## Usage\n\n```pony\nuse \"endianness\"\n\nactor Main\n  new create (env: Env) =\u003e\n    try\n      env.out.print(BigEndian.u16([0x80; 0xff])?.string()) // 33023\n      env.out.print(LittleEndian.u16([0x80; 0xff])?.string()) // 65408\n    end\n```\n\n## API\n\n### Primitive `LittleEndian`\n\n#### `u8(Array[U8] box, offset: USize = 0): U8 ?`\n  Read a U8 in LE order from `v` starting at `offset` (default 0),\n  consuming 1 byte.\n  May error if not enough bytes are available from `offset`\n#### `u16(Array[U8] box, offset: USize = 0): U16 ?`\n  Read a U16 in LE order from `v` starting at `offset` (default 0),\n  consuming 2 bytes.\n  May error if not enough bytes are available from `offset`\n#### `u32(Array[U8] box, offset: USize = 0): U32 ?`\n  Read a U32 in LE order from `v` starting at `offset` (default 0),\n  consuming 4 bytes.\n  May error if not enough bytes are available from `offset`\n#### `u64(Array[U8] box, offset: USize = 0): U64 ?`\n  Read a U64 in LE order from `v` starting at `offset` (default 0),\n  consuming 8 bytes.\n  May error if not enough bytes are available from `offset`\n#### `u128(Array[U8] box, offset: USize = 0): U128 ?`\n  Read a U128 in LE order from `v` starting at `offset` (default 0),\n  consuming 16 bytes.\n  May error if not enough bytes are available from `offset`\n#### `i8(Array[U8] box, offset: USize = 0): I8 ?`\n  Read a I8 in LE order from `v` starting at `offset` (default 0),\n  consuming 1 byte.\n  May error if not enough bytes are available from `offset`\n#### `i16(Array[U8] box, offset: USize = 0): I16 ?`\n  Read a I16 in LE order from `v` starting at `offset` (default 0),\n  consuming 2 bytes.\n  May error if not enough bytes are available from `offset`\n#### `i32(Array[U8] box, offset: USize = 0): I32 ?`\n  Read a I32 in LE order from `v` starting at `offset` (default 0),\n  consuming 4 bytes.\n  May error if not enough bytes are available from `offset`\n#### `i64(Array[U8] box, offset: USize = 0): I64 ?`\n  Read a I64 in LE order from `v` starting at `offset` (default 0),\n  consuming 8 bytes.\n  May error if not enough bytes are available from `offset`\n#### `i128(Array[U8] box, offset: USize = 0): I128 ?`\n  Read a I128 in LE order from `v` starting at `offset` (default 0),\n  consuming 16 bytes.\n  May error if not enough bytes are available from `offset`\n\n### Primitive `BigEndian`\n\n#### `u8(Array[U8] box, offset: USize = 0): U8 ?`\n  Read a U8 in BE (network) order from `v` starting at `offset` (default 0),\n  consuming 1 byte.\n  May error if not enough bytes are available from `offset`\n#### `u16(Array[U8] box, offset: USize = 0): U16 ?`\n  Read a U16 in BE (network) order from `v` starting at `offset` (default 0),\n  consuming 2 bytes.\n  May error if not enough bytes are available from `offset`\n#### `u32(Array[U8] box, offset: USize = 0): U32 ?`\n  Read a U32 in BE (network) order from `v` starting at `offset` (default 0),\n  consuming 4 bytes.\n  May error if not enough bytes are available from `offset`\n#### `u64(Array[U8] box, offset: USize = 0): U64 ?`\n  Read a U64 in BE (network) order from `v` starting at `offset` (default 0),\n  consuming 8 bytes.\n  May error if not enough bytes are available from `offset`\n#### `u128(Array[U8] box, offset: USize = 0): U128 ?`\n  Read a U128 in BE (network) order from `v` starting at `offset` (default 0),\n  consuming 16 bytes.\n  May error if not enough bytes are available from `offset`\n#### `i8(Array[U8] box, offset: USize = 0): I8 ?`\n  Read a I8 in BE (network) order from `v` starting at `offset` (default 0),\n  consuming 1 byte.\n  May error if not enough bytes are available from `offset`\n#### `i16(Array[U8] box, offset: USize = 0): I16 ?`\n  Read a I16 in BE (network) order from `v` starting at `offset` (default 0),\n  consuming 2 bytes.\n  May error if not enough bytes are available from `offset`\n#### `i32(Array[U8] box, offset: USize = 0): I32 ?`\n  Read a I32 in BE (network) order from `v` starting at `offset` (default 0),\n  consuming 4 bytes.\n  May error if not enough bytes are available from `offset`\n#### `i64(Array[U8] box, offset: USize = 0): I64 ?`\n  Read a I64 in BE (network) order from `v` starting at `offset` (default 0),\n  consuming 8 bytes.\n  May error if not enough bytes are available from `offset`\n#### `i128(Array[U8] box, offset: USize = 0): I128 ?`\n  Read a I128 in BE (network) order from `v` starting at `offset` (default 0),\n  consuming 16 bytes.\n  May error if not enough bytes are available from `offset`\n\n## Install\n\n```sh\nstable add github emilbayes/endianness\n```\n\n## License\n\n[ISC](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilbayes%2Fpony-endianness","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femilbayes%2Fpony-endianness","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femilbayes%2Fpony-endianness/lists"}