{"id":15757043,"url":"https://github.com/tgymnich/bitwiserotate","last_synced_at":"2025-06-25T18:36:08.123Z","repository":{"id":124645744,"uuid":"271107088","full_name":"tgymnich/BitwiseRotate","owner":"tgymnich","description":"🔄 Safe and efficient bitwise rotation in Swift","archived":false,"fork":false,"pushed_at":"2021-12-02T02:47:21.000Z","size":52,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-31T08:30:38.632Z","etag":null,"topics":["bitwise-operators","bitwise-rotation","rol","ror","rotation","swift","swift-library"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tgymnich.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":"2020-06-09T20:50:35.000Z","updated_at":"2023-10-27T11:02:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"cc55bb4a-680c-4bec-a161-3699827fb413","html_url":"https://github.com/tgymnich/BitwiseRotate","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/tgymnich/BitwiseRotate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgymnich%2FBitwiseRotate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgymnich%2FBitwiseRotate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgymnich%2FBitwiseRotate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgymnich%2FBitwiseRotate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tgymnich","download_url":"https://codeload.github.com/tgymnich/BitwiseRotate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tgymnich%2FBitwiseRotate/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261931616,"owners_count":23232120,"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":["bitwise-operators","bitwise-rotation","rol","ror","rotation","swift","swift-library"],"created_at":"2024-10-04T09:03:58.662Z","updated_at":"2025-06-25T18:36:08.083Z","avatar_url":"https://github.com/tgymnich.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BitwiseRotate\n![Swift](https://github.com/tgymnich/BitwiseRotate/workflows/Swift/badge.svg)\n[![codecov](https://codecov.io/gh/tgymnich/BitwiseRotate/branch/main/graph/badge.svg?token=K3HRG7M134)](https://codecov.io/gh/tgymnich/BitwiseRotate)\n\nA swift package providing bitwise rotation operators for `FixedWidthInteger` and `SIMD` vectors with a `FixedWidthInteger` scalar.\nThis package is written in a sepcific way to [compile](https://www.godbolt.org/z/4Ggohy) to `ror` and `rol` on x86. On ARM only `UInt32`, `UInt64`, `Int32` and `Int64` [compile](https://gist.github.com/tgymnich/84f1cfed5038dff435c9cdb28ceb8f10) to `ror`. Rotations on `SIMD` vectors don't yet compile to the most efficient instructions possible.\n\n# Setup\n\nIn your Package.swift add:\n```swift\n.package(url: \"https://github.com/tgymnich/BitwiseRotate.git\", from: \"1.1.1\")\n```\n\n# Usage\n\n\n## rol\n```swift\nlet someBits: UInt8 = 0b01010100 \u003c\u003c\u003c 3 // returns 0b10100010\n```\n\n## ror\n```swift\nlet someBits: UInt8 = 0b01010100 \u003e\u003e\u003e 3 // returns 0b10001010\n```\n\n## SIMD\n```swift\nlet someBitVector = SIMD3\u003cUInt8\u003e(arrayLiteral: 0b01010100,0b11011100,0b00011000) \u003c\u003c\u003c 1 // (0b10101000, 0b10111001, 0b00110000) \n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftgymnich%2Fbitwiserotate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftgymnich%2Fbitwiserotate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftgymnich%2Fbitwiserotate/lists"}