Title: [fork-ffi] integers: toStringAs — For non-decimal bases the digit alphabet is uppercase… · Issue #87 · purescript-lua/purescript-lua · GitHub
Open Graph Title: [fork-ffi] integers: toStringAs — For non-decimal bases the digit alphabet is uppercase… · Issue #87 · purescript-lua/purescript-lua
X Title: [fork-ffi] integers: toStringAs — For non-decimal bases the digit alphabet is uppercase… · Issue #87 · purescript-lua/purescript-lua
Description: Package: purescript-lua-integers File: src/Data/Int.lua Function: toStringAs Class: show-escaping Severity: high For non-decimal bases the digit alphabet is uppercase ("0123456789ABCDEF..."), so toStringAs hexadecimal 255 yields "FF" and...
Open Graph Description: Package: purescript-lua-integers File: src/Data/Int.lua Function: toStringAs Class: show-escaping Severity: high For non-decimal bases the digit alphabet is uppercase ("0123456789ABCDEF..."), so to...
X Description: Package: purescript-lua-integers File: src/Data/Int.lua Function: toStringAs Class: show-escaping Severity: high For non-decimal bases the digit alphabet is uppercase ("0123456789ABCDEF...&quo...
Opengraph URL: https://github.com/purescript-lua/purescript-lua/issues/87
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[fork-ffi] integers: toStringAs — For non-decimal bases the digit alphabet is uppercase…","articleBody":"**Package:** purescript-lua-integers \n**File:** `src/Data/Int.lua` \n**Function:** `toStringAs` \n**Class:** show-escaping **Severity:** high\n\nFor non-decimal bases the digit alphabet is uppercase (\"0123456789ABCDEF...\"), so `toStringAs hexadecimal 255` yields \"FF\" and `toStringAs hexadecimal 2147483647` yields \"7FFFFFFF\". The upstream JS is `i.toString(radix)`, which produces LOWERCASE digits. The package's own tests require lowercase: `toStringAs hexadecimal 255 == \"ff\"` and `toStringAs hexadecimal 2147483647 == \"7fffffff\"` (Test/Data/Int.purs lines 106, 109), and the round-trip doc example `fromStringAs hexadecimal \"ff\" == Just 255` assumes lowercase. The uppercase output fails these assertions.\n\n**Current (Lua):**\n```lua\nlocal digits = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n```\n\n**Expected:** Lowercase alphanumeric digits matching JS Number.prototype.toString(radix), e.g. toStringAs hexadecimal 255 == \"ff\".\n\n**Proposed fix:**\n```lua\nlocal digits = \"0123456789abcdefghijklmnopqrstuvwxyz\"\n```\n\n_Found by the FFI audit; reproduced under Lua 5.1._","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-06-15T11:24:07Z","url":"https://github.com/purescript-lua/purescript-lua/issues/87"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:2820c7a0-9187-dbb7-1984-fd9490eb5d62 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95FC:2463BD:9465F1:C1675D:6B00DFA9 |
| html-safe-nonce | 70d073fd0c8f71206cd38030ff7d82bb311f67af748eb70710d2b201cd83f0bd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUZDOjI0NjNCRDo5NDY1RjE6QzE2NzVEOjZCMDBERkE5IiwidmlzaXRvcl9pZCI6IjgyNDMxNDQwNTY1NDk0NjYwMjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9016d22861f49d8fe8f0c7e754e67f5eee33ca16691873589366bc15cb419915 |
| hovercard-subject-tag | issue:4664608011 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/purescript-lua/purescript-lua/87/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8534232fae12939ad0c343c48b5503ad3bec9fa7177ae31750088a7228e397fb/purescript-lua/purescript-lua/issues/87 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8534232fae12939ad0c343c48b5503ad3bec9fa7177ae31750088a7228e397fb/purescript-lua/purescript-lua/issues/87 |
| og:image:alt | Package: purescript-lua-integers File: src/Data/Int.lua Function: toStringAs Class: show-escaping Severity: high For non-decimal bases the digit alphabet is uppercase ("0123456789ABCDEF..."), so to... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Unisay |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| turbo-cache-control | no-preview |
| go-import | github.com/purescript-lua/purescript-lua git https://github.com/purescript-lua/purescript-lua.git |
| octolytics-dimension-user_id | 131581790 |
| octolytics-dimension-user_login | purescript-lua |
| octolytics-dimension-repository_id | 587200487 |
| octolytics-dimension-repository_nwo | purescript-lua/purescript-lua |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 587200487 |
| octolytics-dimension-repository_network_root_nwo | purescript-lua/purescript-lua |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width