{"id":25456812,"url":"https://github.com/szaghi/befor64","last_synced_at":"2026-02-27T21:29:47.535Z","repository":{"id":26472977,"uuid":"29924686","full_name":"szaghi/BeFoR64","owner":"szaghi","description":"BeFoR64, Base64 encoding/decoding library for FoRtran poor men","archived":false,"fork":false,"pushed_at":"2022-10-12T16:50:14.000Z","size":1803,"stargazers_count":19,"open_issues_count":2,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-06-21T18:01:58.775Z","etag":null,"topics":["base64","decoding","encoding","fortran","oop"],"latest_commit_sha":null,"homepage":null,"language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/szaghi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.bsd-2.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-27T17:07:55.000Z","updated_at":"2024-03-17T23:51:56.000Z","dependencies_parsed_at":"2023-01-14T04:44:05.991Z","dependency_job_id":null,"html_url":"https://github.com/szaghi/BeFoR64","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FBeFoR64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FBeFoR64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FBeFoR64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FBeFoR64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szaghi","download_url":"https://codeload.github.com/szaghi/BeFoR64/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239394685,"owners_count":19631122,"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":["base64","decoding","encoding","fortran","oop"],"created_at":"2025-02-18T01:51:21.820Z","updated_at":"2026-02-27T21:29:47.527Z","avatar_url":"https://github.com/szaghi.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BeFoR64\n\n\u003e#### Base64 encoding/decoding library for Fortran\n\u003e A KISS pure Fortran 2003+ library for encoding and decoding any intrinsic type — integers, reals, characters, and unlimited polymorphic variables — to and from Base64 strings.\n\n[![GitHub tag](https://img.shields.io/github/v/tag/szaghi/BeFoR64)](https://github.com/szaghi/BeFoR64/tags)\n[![GitHub issues](https://img.shields.io/github/issues/szaghi/BeFoR64)](https://github.com/szaghi/BeFoR64/issues)\n[![CI](https://github.com/szaghi/BeFoR64/actions/workflows/ci.yml/badge.svg)](https://github.com/szaghi/BeFoR64/actions/workflows/ci.yml)\n[![coverage](https://img.shields.io/endpoint?url=https://szaghi.github.io/BeFoR64/coverage.json)](https://github.com/szaghi/BeFoR64/actions/workflows/ci.yml)\n\n| 🔢 **All intrinsic types**\u003cbr\u003eIntegers `I1P`–`I8P`, reals `R4P`/`R8P`/opt. `R16P`, characters, unlimited polymorphic | 📐 **Scalars \u0026 arrays**\u003cbr\u003eScalar and rank-1 array support for all types | 🔗 **Pack mixed data**\u003cbr\u003eHeterogeneous arrays via `pack_data` | 🔄 **Bidirectional**\u003cbr\u003eSymmetric encode and decode |\n|:---:|:---:|:---:|:---:|\n| 🎯 **KISS API**\u003cbr\u003e`b64_init`, `b64_encode`, `b64_decode` — that's it | ⚡ **Pure Fortran 2003+**\u003cbr\u003eNo C, no external deps; tested with gfortran \u0026 ifort | 🔧 **Two build systems**\u003cbr\u003efpm and FoBiS.py — static, shared, and test modes | 🔓 **Open \u0026 documented**\u003cbr\u003eGPL v3 · BSD · MIT; full API reference \u0026 usage guide |\n\nFor full documentations (guide, tutorial, examples, etc...) see the [BeFoR64 website](https://szaghi.github.io/BeFoR64/).\n\n---\n\n## Authors\n\n- Stefano Zaghi — [@szaghi](https://github.com/szaghi)\n\nContributions are welcome — see the [Contributing](/guide/contributing) page.\n\n## Copyrights\n\nThis project is distributed under a multi-licensing system:\n\n- **FOSS projects**: [GPL v3](http://www.gnu.org/licenses/gpl-3.0.html)\n- **Closed source / commercial**: [BSD 2-Clause](http://opensource.org/licenses/BSD-2-Clause), [BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause), or [MIT](http://opensource.org/licenses/MIT)\n\n\u003e Anyone interested in using, developing, or contributing to this project is welcome — pick the license that best fits your needs.\n\n---\n\n## A taste of BeFoR64\n\n```fortran\nuse befor64\n\ncall b64_init()\n\ncharacter(len=:), allocatable :: code\ncall b64_encode(n=1.0_R8P, code=code)        ! encode a scalar real\ncall b64_encode(n=[1_I4P, 2_I4P], code=code) ! or an integer array\n\nreal(R8P) :: val\ncall b64_decode(code='AAAAAAAA8D8=', n=val)  ! decode back\n```\n\n---\n\n## Usage\n\nBeFoR64 exposes four public procedures and one flag:\n\n| Symbol | Description |\n|--------|-------------|\n| `b64_init` | Initialise the library — call once before any encode/decode |\n| `is_b64_initialized` | Logical flag, true after `b64_init` |\n| `b64_encode` / `b64_encode_up` | Encode intrinsic or unlimited polymorphic variable to Base64 |\n| `b64_decode` / `b64_decode_up` | Decode a Base64 string back to an intrinsic or polymorphic variable |\n| `pack_data` | Pack two numeric arrays of different kinds into a byte stream for mixed-type encoding |\n\nEncoded strings are returned as `character(len=:), allocatable` — a Fortran 2003 feature required by the compiler.\n\n```fortran\n! heterogeneous data: pack first, then encode\nreal(R8P)               :: a(12)\nreal(R4P)               :: b(7)\ninteger(I1P), allocatable :: packed(:)\ncharacter(len=:), allocatable :: code\n\ncall pack_data(a1=a, a2=b, packed=packed)\ncall b64_encode(n=packed, code=code)\n```\n\nSee the full [Usage guide](https://szaghi.github.io/BeFoR64/guide/usage) for all supported type combinations.\n\n---\n\n## Install\n\n### FoBiS.py\n\n**Standalone** — clone, build, and install in one command:\n\n```bash\nFoBiS.py install szaghi/BeFoR64 -mode static-gnu\nFoBiS.py install szaghi/BeFoR64 -mode static-gnu --prefix /path/to/prefix\n```\n\n**As a project dependency** — declare BeFoR64 in your `fobos` and run `fetch`:\n\n```ini\n[dependencies]\ndeps_dir = src/third_party\nPENF     = https://github.com/szaghi/BeFoR64\n```\n\n```bash\nFoBiS.py fetch           # fetch and build\nFoBiS.py fetch --update  # re-fetch and rebuild\n```\n\n### fpm\n\nAdd to your `fpm.toml`:\n\n```toml\n[dependencies]\nBeFoR64 = { git = \"https://github.com/szaghi/BeFoR64\" }\n```\n\n### CMake\n\n```bash\ncmake -B build \u0026\u0026 cmake --build build\n```\n\n### Makefile\n\n```bash\nmake              # static library\nmake TESTS=yes    # build and run tests\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszaghi%2Fbefor64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszaghi%2Fbefor64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszaghi%2Fbefor64/lists"}