turbob64


Nameturbob64 JSON
Version 1.1.1 PyPI version JSON
download
home_page
SummaryCython bindings for Turbo Base64
upload_time2023-08-07 00:40:17
maintainer
docs_urlNone
author
requires_python>=3.7
licenseGPL-3.0
keywords base64 encoding decoding turbo cython
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">
    Turbo Base64
</h1>


<p align="center">
    <a href="https://github.com/daijro/turbobase64/blob/main/LICENSE">
        <img src="https://img.shields.io/github/license/daijro/turbobase64?color=yellow">
    </a>
    <a href="https://python.org/">
        <img src="https://img.shields.io/badge/python-3.7&#8208;3.11-blue">
    </a>
    <a href="https://github.com/cython/cython">
        <img src="https://img.shields.io/badge/language-cython-black.svg">
    </a>
    <a href="https://pypi.org/project/turbob64/">
        <img alt="PyPI" src="https://img.shields.io/pypi/v/turbob64.svg?color=orange">
    </a>
    <a href="https://ci.appveyor.com/project/daijro/turbobase64">
        <img alt="AppVeyor" src="https://ci.appveyor.com/api/projects/status/github/daijro/turbobase64?svg=true">
    </a>
    <h4 align="center">
        🚀 Lightning fast base64 encoding for Python
    </h4>
</p>


## ✨ Features

- 20-30x faster than the standard library
- Benchmarks faster than any other C base64 library
- Fastest implementation of AVX, AVX2, and AVX512 base64 encoding
- No other dependencies

<hr width=50>

## âš¡ How fast is it?

Graph generated from [benchmark.py](https://github.com/daijro/turbobase64/blob/main/benchmark.py):

<img src="https://i.imgur.com/jC3ka6e.png" width=500>

<hr width=50>

## 💻 Usage

```py
>>> import turbob64
```

This will automatically detect the fastest algorithm your CPU is capable of and use it.

### Encoding

```py
>>> turbob64.b64encode(b'Hello World!')
b'SGVsbG8gV29ybGQh'
```

### Decoding

```py
>>> turbob64.b64decode(b'SGVsbG8gV29ybGQh')
b'Hello World!'
```

<hr width=50>

### Other Functions

<details>
<summary>
Directly call CPU-specific algorithms
</summary>

Memory efficient (small lookup tables) scalar but slower version

```py
turbob64.b64senc(b'Hello World!')
turbob64.b64sdec(b'SGVsbG8gV29ybGQh')
```

Fast scalar

```py
turbob64.b64xenc(b'Hello World!')
turbo64.b64xdec(b'SGVsbG8gV29ybGQh')
```

ssse3 SIMD

```py
turbob64.b64v128enc(b'Hello World!')
turbob64.b64v128dec(b'SGVsbG8gV29ybGQh')
```

avx SIMD

```py
turbob64.b64v128aenc(b'Hello World!')
turbob64.b64v128adec(b'SGVsbG8gV29ybGQh')
```

avx2 SIMD

```py
turbob64.b64v256enc(b'Hello World!')
turbob64.b64v256dec(b'SGVsbG8gV29ybGQh')
```

avx2 SIMD (optimized for short strings)

```py
turbob64.b64v256enc_short(b'Hello World!')
turbob64.b64v256dec_short(b'SGVsbG8gV29ybGQh')
```

avx512_vbmi SIMD

```py
turbob64.b64v512enc(b'Hello World!')
turbob64.b64v512dec(b'SGVsbG8gV29ybGQh')
```

</details>

---

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "turbob64",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "base64,encoding,decoding,turbo,cython",
    "author": "",
    "author_email": "daijro <daijro.dev@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/cb/71/7858095c8d9fe97b4cacd568e67abf1456540b1125c94804d59cd71a280a/turbob64-1.1.1.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">\r\n    Turbo Base64\r\n</h1>\r\n\r\n\r\n<p align=\"center\">\r\n    <a href=\"https://github.com/daijro/turbobase64/blob/main/LICENSE\">\r\n        <img src=\"https://img.shields.io/github/license/daijro/turbobase64?color=yellow\">\r\n    </a>\r\n    <a href=\"https://python.org/\">\r\n        <img src=\"https://img.shields.io/badge/python-3.7&#8208;3.11-blue\">\r\n    </a>\r\n    <a href=\"https://github.com/cython/cython\">\r\n        <img src=\"https://img.shields.io/badge/language-cython-black.svg\">\r\n    </a>\r\n    <a href=\"https://pypi.org/project/turbob64/\">\r\n        <img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/turbob64.svg?color=orange\">\r\n    </a>\r\n    <a href=\"https://ci.appveyor.com/project/daijro/turbobase64\">\r\n        <img alt=\"AppVeyor\" src=\"https://ci.appveyor.com/api/projects/status/github/daijro/turbobase64?svg=true\">\r\n    </a>\r\n    <h4 align=\"center\">\r\n        \ud83d\ude80 Lightning fast base64 encoding for Python\r\n    </h4>\r\n</p>\r\n\r\n\r\n## \u2728 Features\r\n\r\n- 20-30x faster than the standard library\r\n- Benchmarks faster than any other C base64 library\r\n- Fastest implementation of AVX, AVX2, and AVX512 base64 encoding\r\n- No other dependencies\r\n\r\n<hr width=50>\r\n\r\n## \u26a1 How fast is it?\r\n\r\nGraph generated from [benchmark.py](https://github.com/daijro/turbobase64/blob/main/benchmark.py):\r\n\r\n<img src=\"https://i.imgur.com/jC3ka6e.png\" width=500>\r\n\r\n<hr width=50>\r\n\r\n## \ud83d\udcbb Usage\r\n\r\n```py\r\n>>> import turbob64\r\n```\r\n\r\nThis will automatically detect the fastest algorithm your CPU is capable of and use it.\r\n\r\n### Encoding\r\n\r\n```py\r\n>>> turbob64.b64encode(b'Hello World!')\r\nb'SGVsbG8gV29ybGQh'\r\n```\r\n\r\n### Decoding\r\n\r\n```py\r\n>>> turbob64.b64decode(b'SGVsbG8gV29ybGQh')\r\nb'Hello World!'\r\n```\r\n\r\n<hr width=50>\r\n\r\n### Other Functions\r\n\r\n<details>\r\n<summary>\r\nDirectly call CPU-specific algorithms\r\n</summary>\r\n\r\nMemory efficient (small lookup tables) scalar but slower version\r\n\r\n```py\r\nturbob64.b64senc(b'Hello World!')\r\nturbob64.b64sdec(b'SGVsbG8gV29ybGQh')\r\n```\r\n\r\nFast scalar\r\n\r\n```py\r\nturbob64.b64xenc(b'Hello World!')\r\nturbo64.b64xdec(b'SGVsbG8gV29ybGQh')\r\n```\r\n\r\nssse3 SIMD\r\n\r\n```py\r\nturbob64.b64v128enc(b'Hello World!')\r\nturbob64.b64v128dec(b'SGVsbG8gV29ybGQh')\r\n```\r\n\r\navx SIMD\r\n\r\n```py\r\nturbob64.b64v128aenc(b'Hello World!')\r\nturbob64.b64v128adec(b'SGVsbG8gV29ybGQh')\r\n```\r\n\r\navx2 SIMD\r\n\r\n```py\r\nturbob64.b64v256enc(b'Hello World!')\r\nturbob64.b64v256dec(b'SGVsbG8gV29ybGQh')\r\n```\r\n\r\navx2 SIMD (optimized for short strings)\r\n\r\n```py\r\nturbob64.b64v256enc_short(b'Hello World!')\r\nturbob64.b64v256dec_short(b'SGVsbG8gV29ybGQh')\r\n```\r\n\r\navx512_vbmi SIMD\r\n\r\n```py\r\nturbob64.b64v512enc(b'Hello World!')\r\nturbob64.b64v512dec(b'SGVsbG8gV29ybGQh')\r\n```\r\n\r\n</details>\r\n\r\n---\r\n",
    "bugtrack_url": null,
    "license": "GPL-3.0",
    "summary": "Cython bindings for Turbo Base64",
    "version": "1.1.1",
    "project_urls": {
        "repository": "https://github.com/daijro/turbobase64"
    },
    "split_keywords": [
        "base64",
        "encoding",
        "decoding",
        "turbo",
        "cython"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "aa9b2ee9801dd973325d7e089a87e50be07e5455adc50980267e1f603bb737d0",
                "md5": "b6bd4de369871b333251f61f7e0598a7",
                "sha256": "d20b754eb02b66337c02e03a2b4bed88eac4b6004184250c4a2f8960b9bae3ce"
            },
            "downloads": -1,
            "filename": "turbob64-1.1.1-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "b6bd4de369871b333251f61f7e0598a7",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.7",
            "size": 65682,
            "upload_time": "2023-08-07T00:42:41",
            "upload_time_iso_8601": "2023-08-07T00:42:41.968342Z",
            "url": "https://files.pythonhosted.org/packages/aa/9b/2ee9801dd973325d7e089a87e50be07e5455adc50980267e1f603bb737d0/turbob64-1.1.1-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8aa1a400013a6b89864e6dc485450fbeb198c9f4d8e2b15de88dec424d68e31",
                "md5": "119db35a71607a62dcd9580c8f569bb3",
                "sha256": "a7a947f9b24e6c14976e240f05474f7e08dbb138b66d7fa6bb66afb958fdd706"
            },
            "downloads": -1,
            "filename": "turbob64-1.1.1-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "119db35a71607a62dcd9580c8f569bb3",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.7",
            "size": 66281,
            "upload_time": "2023-08-07T00:45:29",
            "upload_time_iso_8601": "2023-08-07T00:45:29.823069Z",
            "url": "https://files.pythonhosted.org/packages/b8/aa/1a400013a6b89864e6dc485450fbeb198c9f4d8e2b15de88dec424d68e31/turbob64-1.1.1-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a91477d80788a4f07c66e3b2f02983f55adf5c399577ebcbb0e7e3491c0a2c7a",
                "md5": "e7fd09b30e42d01c1652830f5812ada0",
                "sha256": "339624cd8ddff522701c26e7a4ccf44ac2be15428a1372b090a21041feb47267"
            },
            "downloads": -1,
            "filename": "turbob64-1.1.1-cp37-cp37-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "e7fd09b30e42d01c1652830f5812ada0",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 65825,
            "upload_time": "2023-08-07T00:40:19",
            "upload_time_iso_8601": "2023-08-07T00:40:19.595753Z",
            "url": "https://files.pythonhosted.org/packages/a9/14/77d80788a4f07c66e3b2f02983f55adf5c399577ebcbb0e7e3491c0a2c7a/turbob64-1.1.1-cp37-cp37-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fb41ce131440c5ce3564d5b3801a33a2e351bd8fb261232d7721032488fe6b71",
                "md5": "5a0ffc3470f51a967a95ce47304bcccc",
                "sha256": "6815253529d61b70d5ada18f883f49b7690f328ca1d56e0a1af9d675b4ab4164"
            },
            "downloads": -1,
            "filename": "turbob64-1.1.1-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "5a0ffc3470f51a967a95ce47304bcccc",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.7",
            "size": 65791,
            "upload_time": "2023-08-07T00:41:29",
            "upload_time_iso_8601": "2023-08-07T00:41:29.925309Z",
            "url": "https://files.pythonhosted.org/packages/fb/41/ce131440c5ce3564d5b3801a33a2e351bd8fb261232d7721032488fe6b71/turbob64-1.1.1-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "95e3520c2a8af1139b0ddf92bffea0cf9a03e2187fe820d8ab5ca8268548ebc5",
                "md5": "4b0fb32bb5d1bbcd9ea727717acc9d93",
                "sha256": "e5b21c6cfd1e4ee10c0f95cab0f981713529fe0acda46dd784fada1ac3718210"
            },
            "downloads": -1,
            "filename": "turbob64-1.1.1-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "4b0fb32bb5d1bbcd9ea727717acc9d93",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.7",
            "size": 65682,
            "upload_time": "2023-08-07T00:44:05",
            "upload_time_iso_8601": "2023-08-07T00:44:05.112908Z",
            "url": "https://files.pythonhosted.org/packages/95/e3/520c2a8af1139b0ddf92bffea0cf9a03e2187fe820d8ab5ca8268548ebc5/turbob64-1.1.1-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cb717858095c8d9fe97b4cacd568e67abf1456540b1125c94804d59cd71a280a",
                "md5": "8058cf597e7bd0177765e0cbfb479058",
                "sha256": "772be275821403c9854a9811143b18f3657e9e219a878879c45b2effd569f048"
            },
            "downloads": -1,
            "filename": "turbob64-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8058cf597e7bd0177765e0cbfb479058",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 46317,
            "upload_time": "2023-08-07T00:40:17",
            "upload_time_iso_8601": "2023-08-07T00:40:17.405648Z",
            "url": "https://files.pythonhosted.org/packages/cb/71/7858095c8d9fe97b4cacd568e67abf1456540b1125c94804d59cd71a280a/turbob64-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-07 00:40:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "daijro",
    "github_project": "turbobase64",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "appveyor": true,
    "lcname": "turbob64"
}
        
Elapsed time: 0.78053s